Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


oracle.irm.engine.rights.journal
Class ContextJournalEntryCollectionFactory

java.lang.Object
  extended by oracle.irm.engine.rights.journal.ContextJournalEntryCollectionFactory


public final class ContextJournalEntryCollectionFactory
extends Object

Context Journal Entry collection factory and utilities. This class provides methods for creating new instances of ContextJournalEntry collections as well as providing a number of collection based utility methods and fields. These methods are provided mainly for convenience and to provide a consistent way to create Context Journal Entry collections. Methods that take collection parameters make no assumptions about what collection implementation is used, so the use of these factory style methods is at the developers discretion.


Field Summary
static Collection<ContextJournalEntry> EMPTY_CONTEXT_JOURNAL_ENTRIES
          An empty Context Journal Entry collection.

 

Method Summary
static Map<UUID,ContextJournalEntry> contextJournalEntriesAsMap(Collection<ContextJournalEntry> collection)
          Create a map keyed on Uuid from a collection of Context Journal Entry elements.
static Set<ContextJournalEntry> contextJournalEntriesAsSet(Collection<ContextJournalEntry> collection)
          Create a set of Context Journal Entry elements from a collection.
static Collection<ContextJournalEntry> copyContextJournalEntries(Collection<ContextJournalEntry> collection)
          Create a shallow copy of a Context Journal Entry collection.
static Collection<ContextJournalEntry> createContextJournalEntries(ContextJournalEntry... elements)
          Create a Context Journal Entry collection containing zero or more elements.
static Collection<ContextJournalEntry> createContextJournalEntries(int capacity)
          Create an empty Context Journal Entry collection with a capacity specified.
static ContextJournalEntry getContextJournalEntryByUuid(Collection<ContextJournalEntry> collection, UUID key)
          Get an element from a Context Journal Entry collection by Uuid.
static Collection<ContextJournalEntry> unmodifiableContextJournalEntries(Collection<ContextJournalEntry> value)
          Create an immutable shallow copy of a Context Journal Entry collection.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

EMPTY_CONTEXT_JOURNAL_ENTRIES

public static final Collection<ContextJournalEntry> EMPTY_CONTEXT_JOURNAL_ENTRIES
An empty Context Journal Entry collection. This empty collection is immutable. This field is useful if a method requires a collection argument but the caller wants to supply an empty collection. Using this field value rather than passing null can aid code clarity.

Method Detail

createContextJournalEntries

public static Collection<ContextJournalEntry> createContextJournalEntries(ContextJournalEntry... elements)
Create a Context Journal Entry collection containing zero or more elements. Creates a collection and adds all of the provided elements into the specified collection. This method is provided as a convenience method as it allows creation of an empty collection, a collection with one element or a collection with many elements (all in one line of code).
Parameters:
elements - The elements to add into the collection.
Returns:
The collection containing the specified elements. If no elements are provided an empty collection is returned.

createContextJournalEntries

public static Collection<ContextJournalEntry> createContextJournalEntries(int capacity)
Create an empty Context Journal Entry collection with a capacity specified. Creates an empty collection with an initial capacity for n elements.
Parameters:
capacity - The initial collection capacity.
Returns:
The empty collection with the specified capacity.

copyContextJournalEntries

public static Collection<ContextJournalEntry> copyContextJournalEntries(Collection<ContextJournalEntry> collection)
Create a shallow copy of a Context Journal Entry collection. A shallow copy creates a new collection which contains the elements of the provided collection.
Parameters:
collection - The collection to copy.
Returns:
The copy of the collection. If the provided collection is null, an empty collection is returned.

contextJournalEntriesAsSet

public static Set<ContextJournalEntry> contextJournalEntriesAsSet(Collection<ContextJournalEntry> collection)
Create a set of Context Journal Entry elements from a collection. Context Journal Entry objects can be logically compared using equals. When adding Context Journal Entry objects into a set duplicates will be removed.
Parameters:
collection - The collection to copy.
Returns:
The set. If the provided collection is null, an empty set is returned.

unmodifiableContextJournalEntries

public static Collection<ContextJournalEntry> unmodifiableContextJournalEntries(Collection<ContextJournalEntry> value)
Create an immutable shallow copy of a Context Journal Entry collection. Context Journal Entry objects are immutable (cannot be changed once created). An immutable collection of Context Journal Entry elements can therefore be treated as immutable (neither the collection or elements can be changed once created).
Parameters:
value - The collection to copy.
Returns:
The immutable collection. If the provided collection is null, an empty collection is returned.

contextJournalEntriesAsMap

public static Map<UUID,ContextJournalEntry> contextJournalEntriesAsMap(Collection<ContextJournalEntry> collection)
Create a map keyed on Uuid from a collection of Context Journal Entry elements. This method creates a map of Context Journal Entry elements, using the Uuid property as the map key. The map will contain a snap shot of the elements from the provided collection. Any changes to the collection after calling this method are not reflected in the map. If the collection contains duplicate elements the map will contain the element that is returned last from the collection's iterator.
Parameters:
collection - The collection to convert to a map.
Returns:
A map. If the provided collection is null, an empty map is returned.

getContextJournalEntryByUuid

public static ContextJournalEntry getContextJournalEntryByUuid(Collection<ContextJournalEntry> collection,
                                                               UUID key)
Get an element from a Context Journal Entry collection by Uuid. This method searches the collection for the first instance of a Context Journal Entry that matches the provided Uuid (first in terms of the order of elements returned by the collection iterator).
Parameters:
collection - The collection.
key - The key.
Returns:
The element, or null if the element with that key value does not exist.

Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


Copyright © 2011, Oracle. All rights reserved.