com.unboundid.ldap.sdk.migrate.ldapjdk
Class LDAPModificationSet

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

@NotExtensible
@Mutable
@ThreadSafety(level=NOT_THREADSAFE)
public class LDAPModificationSet
extends java.lang.Object
implements java.io.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:
Serialized Form

Constructor Summary
LDAPModificationSet()
          Creates an empty set of modifications.
 
Method Summary
 void add(int op, LDAPAttribute attr)
          Adds a modification to this modification set.
 LDAPModification elementAt(int index)
          Retrieves the LDAP modification at the specified position in this modification set.
 void remove(java.lang.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 size()
          Retrieves the number of modifications in this modification set.
 LDAPModification[] toArray()
          Retrieves the contents of this set as an array of LDAP modifications.
 java.lang.String toString()
          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 Detail

LDAPModificationSet

public LDAPModificationSet()
Creates an empty set of modifications.

Method Detail

add

public void add(int op,
                LDAPAttribute attr)
Adds a modification to this modification set.

Parameters:
op - The modification type for the modification.
attr - The attribute for the modification.

elementAt

public LDAPModification elementAt(int index)
                           throws java.lang.IndexOutOfBoundsException
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:
java.lang.IndexOutOfBoundsException - If the provided index is invalid.

removeElementAt

public void removeElementAt(int index)
                     throws java.lang.IndexOutOfBoundsException
Removes the LDAP modification at the specified position in this modification set.

Parameters:
index - The position of the LDAP modification to remove.
Throws:
java.lang.IndexOutOfBoundsException - If the provided index is invalid.

remove

public void remove(java.lang.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

public LDAPModification[] 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

public java.lang.String toString()
Retrieves a string representation of this modification set.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this modification set.