@NotExtensible @Mutable @ThreadSafety(level=NOT_THREADSAFE) public class LDAPAttributeSet extends java.lang.Object implements java.io.Serializable
Attribute
objects should be used instead.Constructor and Description |
---|
LDAPAttributeSet()
Creates a new LDAP attribute set with no attributes.
|
LDAPAttributeSet(LDAPAttribute[] attrs)
Creates a new LDAP attribute set with the provided attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
add(LDAPAttribute attr)
Adds the provided attribute to this attribute set.
|
LDAPAttributeSet |
duplicate()
Creates a duplicate of this attribute set.
|
LDAPAttribute |
elementAt(int index)
Retrieves the attribute at the specified position in this attribute set.
|
LDAPAttribute |
getAttribute(java.lang.String attrName)
Retrieves the attribute from this set whose name exactly matches the
provided name.
|
LDAPAttribute |
getAttribute(java.lang.String attrName,
java.lang.String lang)
Retrieves the attribute with the specified base name and the specified
language subtype.
|
java.util.Enumeration<LDAPAttribute> |
getAttributes()
Retrieves an enumeration of the attributes in this set.
|
LDAPAttributeSet |
getSubset(java.lang.String subtype)
Retrieves a subset of the attributes in this attribute set which contain
the specified subtype.
|
void |
remove(java.lang.String name)
Removes the attribute with the specified name.
|
void |
removeElementAt(int index)
Removes the attribute at the specified position in this attribute set.
|
int |
size()
Retrieves the number of attributes contained in this attribute set.
|
java.lang.String |
toString()
Retrieves a string representation of this attribute set.
|
public LDAPAttributeSet()
public LDAPAttributeSet(@NotNull LDAPAttribute[] attrs)
attrs
- The set of attributes to include in the set.@NotNull public java.util.Enumeration<LDAPAttribute> getAttributes()
@NotNull public LDAPAttributeSet getSubset(@NotNull java.lang.String subtype)
subtype
- The subtype for which to retrieve all of the attributes.@Nullable public LDAPAttribute getAttribute(@NotNull java.lang.String attrName)
attrName
- The name of the attribute to retrieve.null
if there is no such
attribute in this set.@Nullable public LDAPAttribute getAttribute(@NotNull java.lang.String attrName, @Nullable java.lang.String lang)
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.null
if there is no such attribute.@NotNull public LDAPAttribute elementAt(int index) throws java.lang.IndexOutOfBoundsException
index
- The position of the attribute to retrieve.java.lang.IndexOutOfBoundsException
- If the provided index invalid.public void add(@NotNull LDAPAttribute attr)
attr
- The attribute to be added to this set.public void remove(@NotNull java.lang.String name)
name
- The name of the attribute to remove.public void removeElementAt(int index) throws java.lang.IndexOutOfBoundsException
index
- The position of the attribute to remove.java.lang.IndexOutOfBoundsException
- If the provided index is invalid.public int size()
@NotNull public LDAPAttributeSet duplicate()