Class LDAPModificationSet

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

This class provides a data structure that represents a set of LDAP modifications.

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, an array or collection of Modification objects should be used instead.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty set of modifications.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int op, LDAPAttribute attr)
    Adds a modification to this modification set.
    elementAt(int index)
    Retrieves the LDAP modification at the specified position in this modification set.
    void
    remove(String name)
    Removes the first LDAP modification in this set targeting the specified attribute.
    void
    removeElementAt(int index)
    Removes the LDAP modification at the specified position in this modification set.
    int
    Retrieves the number of modifications in this modification set.
    Retrieves the contents of this set as an array of LDAP modifications.
    Retrieves a string representation of this modification set.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • add

      public void add(int op, @NotNull LDAPAttribute attr)
      Adds a modification to this modification set.
      Parameters:
      op - The modification type for the modification.
      attr - The attribute for the modification.
    • elementAt

      Retrieves the LDAP modification at the specified position in this modification set.
      Parameters:
      index - The position of the LDAP modification to retrieve.
      Returns:
      The requested modification.
      Throws:
      IndexOutOfBoundsException - If the provided index is invalid.
    • removeElementAt

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

      public void remove(@NotNull String name)
      Removes the first LDAP modification in this set targeting the specified attribute.
      Parameters:
      name - The name of the attribute to remove.
    • size

      public int size()
      Retrieves the number of modifications in this modification set.
      Returns:
      The number of modifications in this modification set.
    • toArray

      Retrieves the contents of this set as an array of LDAP modifications.
      Returns:
      An array of the LDAP modifications contained in this set.
    • toString

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