Class LDAPAttributeSet
java.lang.Object
com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPAttributeSet
- All Implemented Interfaces:
Serializable
@NotExtensible
@Mutable
@ThreadSafety(level=NOT_THREADSAFE)
public class LDAPAttributeSet
extends Object
implements 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
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 Summary
ConstructorsConstructorDescriptionCreates a new LDAP attribute set with no attributes.LDAPAttributeSet(LDAPAttribute[] attrs) Creates a new LDAP attribute set with the provided attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(LDAPAttribute attr) Adds the provided attribute to this attribute set.Creates a duplicate of this attribute set.elementAt(int index) Retrieves the attribute at the specified position in this attribute set.getAttribute(String attrName) Retrieves the attribute from this set whose name exactly matches the provided name.getAttribute(String attrName, String lang) Retrieves the attribute with the specified base name and the specified language subtype.Retrieves an enumeration of the attributes in this set.Retrieves a subset of the attributes in this attribute set which contain the specified subtype.voidRemoves the attribute with the specified name.voidremoveElementAt(int index) Removes the attribute at the specified position in this attribute set.intsize()Retrieves the number of attributes contained in this attribute set.toString()Retrieves a string representation of this attribute set.
-
Constructor Details
-
LDAPAttributeSet
public 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
nullif 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, ornullif there should not be a language subtype.- Returns:
- The attribute with the specified base name and language subtype,
or
nullif 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
Adds the provided attribute to this attribute set.- Parameters:
attr- The attribute to be added to this set.
-
remove
Removes the attribute with the specified name.- Parameters:
name- The name of the attribute to remove.
-
removeElementAt
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
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.
-