Class LDAPAttributeSet

java.lang.Object
com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPAttributeSet
All Implemented Interfaces:
Serializable

This class provides a data structure that contains a set of LDAP attribute objects.

This class is primarily intended to be used in the process of updating applications which use the Netscape Directory SDK for Java to switch to or coexist with the UnboundID LDAP SDK for Java. For applications not written using the Netscape Directory SDK for Java, arrays or collections of Attribute objects should be used instead.
See Also:
  • Constructor Details

    • LDAPAttributeSet

      Creates a new LDAP attribute set with no attributes.
    • LDAPAttributeSet

      Creates a new LDAP attribute set with the provided attributes.
      Parameters:
      attrs - The set of attributes to include in the set.
  • Method Details

    • getAttributes

      Retrieves an enumeration of the attributes in this set.
      Returns:
      An enumeration of the attributes in this set.
    • getSubset

      Retrieves a subset of the attributes in this attribute set which contain the specified subtype.
      Parameters:
      subtype - The subtype for which to retrieve all of the attributes.
      Returns:
      A new attribute set with all attributes from this set containing the specified subtype.
    • getAttribute

      Retrieves the attribute from this set whose name exactly matches the provided name.
      Parameters:
      attrName - The name of the attribute to retrieve.
      Returns:
      The requested attribute, or null if there is no such attribute in this set.
    • getAttribute

      Retrieves the attribute with the specified base name and the specified language subtype.
      Parameters:
      attrName - The base name for the attribute to retrieve.
      lang - The language subtype to retrieve, or null if there should not be a language subtype.
      Returns:
      The attribute with the specified base name and language subtype, or null if there is no such attribute.
    • elementAt

      Retrieves the attribute at the specified position in this attribute set.
      Parameters:
      index - The position of the attribute to retrieve.
      Returns:
      The attribute at the specified position.
      Throws:
      IndexOutOfBoundsException - If the provided index invalid.
    • add

      public void add(@NotNull LDAPAttribute attr)
      Adds the provided attribute to this attribute set.
      Parameters:
      attr - The attribute to be added to this set.
    • remove

      public void remove(@NotNull String name)
      Removes the attribute with the specified name.
      Parameters:
      name - The name of the attribute to remove.
    • removeElementAt

      public void removeElementAt(int index) throws IndexOutOfBoundsException
      Removes the attribute at the specified position in this attribute set.
      Parameters:
      index - The position of the attribute to remove.
      Throws:
      IndexOutOfBoundsException - If the provided index is invalid.
    • size

      public int size()
      Retrieves the number of attributes contained in this attribute set.
      Returns:
      The number of attributes contained in this attribute set.
    • duplicate

      Creates a duplicate of this attribute set.
      Returns:
      A duplicate of this attribute set.
    • toString

      Retrieves a string representation of this attribute set.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this attribute set.