Package org.ldaptive.schema
Class SchemaElementRegistry<K,V extends SchemaElement<K>>
java.lang.Object
org.ldaptive.AbstractFreezable
org.ldaptive.schema.SchemaElementRegistry<K,V>
- Type Parameters:
K- type of element keyV- type of schema element
- All Implemented Interfaces:
Freezable
Class containing a registry that associates element IDs and names with schema elements.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final inthash code seed.Map of keys to elements.private final LoggerLogger for this class.Map of names to elements.Schema elements. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidfreeze()Freezes this object, making it immutable.getElementByKey(K key) Returns the element with the supplied identifier.getElementByName(String name) Returns the element with the supplied name.Returns the schema elements.inthashCode()private voidparseElements(Collection<V> c) Iterates over the supplied collection and updates the registries with each element.voidsetElements(Collection<V> c) Sets the schema elements.toString()Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
Field Details
-
HASH_CODE_SEED
private static final int HASH_CODE_SEEDhash code seed.- See Also:
-
logger
Logger for this class. -
keyRegistry
Map of keys to elements. -
nameRegistry
Map of names to elements. -
schemaElements
Schema elements.
-
-
Constructor Details
-
SchemaElementRegistry
SchemaElementRegistry()
-
-
Method Details
-
freeze
public void freeze()Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
freezein interfaceFreezable- Overrides:
freezein classAbstractFreezable
-
getElements
Returns the schema elements.- Returns:
- schema elements
-
getElementByKey
Returns the element with the supplied identifier.- Parameters:
key- element identifier- Returns:
- element or null if key does not exist
-
getElementByName
Returns the element with the supplied name.- Parameters:
name- element name- Returns:
- element or null if name does not exist
-
setElements
Sets the schema elements.- Parameters:
c- collections of elements
-
equals
-
hashCode
public int hashCode() -
toString
-
parseElements
Iterates over the supplied collection and updates the registries with each element.- Parameters:
c- to parse
-