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 key
V - type of schema element
All Implemented Interfaces:
Freezable

final class SchemaElementRegistry<K,V extends SchemaElement<K>> extends AbstractFreezable
Class containing a registry that associates element IDs and names with schema elements.
  • Field Details

    • HASH_CODE_SEED

      private static final int HASH_CODE_SEED
      hash code seed.
      See Also:
    • logger

      private final Logger logger
      Logger for this class.
    • keyRegistry

      private Map<K,V extends SchemaElement<K>> keyRegistry
      Map of keys to elements.
    • nameRegistry

      private Map<String,V extends SchemaElement<K>> nameRegistry
      Map of names to elements.
    • schemaElements

      private List<V extends SchemaElement<K>> schemaElements
      Schema elements.
  • Constructor Details

    • SchemaElementRegistry

      SchemaElementRegistry()
  • Method Details

    • freeze

      public void freeze()
      Description copied from interface: Freezable
      Freezes this object, making it immutable.
      Specified by:
      freeze in interface Freezable
      Overrides:
      freeze in class AbstractFreezable
    • getElements

      public Collection<V> getElements()
      Returns the schema elements.
      Returns:
      schema elements
    • getElementByKey

      public V getElementByKey(K key)
      Returns the element with the supplied identifier.
      Parameters:
      key - element identifier
      Returns:
      element or null if key does not exist
    • getElementByName

      public V getElementByName(String name)
      Returns the element with the supplied name.
      Parameters:
      name - element name
      Returns:
      element or null if name does not exist
    • setElements

      public void setElements(Collection<V> c)
      Sets the schema elements.
      Parameters:
      c - collections of elements
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parseElements

      private void parseElements(Collection<V> c)
      Iterates over the supplied collection and updates the registries with each element.
      Parameters:
      c - to parse