Package org.springframework.ldap.core
Class LdapAttribute
java.lang.Object
javax.naming.directory.BasicAttribute
org.springframework.ldap.core.LdapAttribute
- All Implemented Interfaces:
Serializable,Cloneable,Attribute
Extends
BasicAttribute to add support for options as
defined in RFC2849.
While uncommon, options can be used to specify additional descriptors for the
attribute. Options are backed by a HashSet of
String.
- See Also:
-
Field Summary
FieldsFields inherited from class javax.naming.directory.BasicAttribute
attrID, ordered, values -
Constructor Summary
ConstructorsConstructorDescriptionLdapAttribute(String id) Creates an unordered attribute with the specified ID.LdapAttribute(String id, boolean ordered) Creates an attribute with the specified ID whose values may be ordered.LdapAttribute(String id, Object value) Creates an unordered attribute with the specified ID and value.LdapAttribute(String id, Object value, boolean ordered) Creates an attribute with the specified ID and value whose values may be ordered.LdapAttribute(String id, Object value, Collection<String> options) Creates an unordered attribute with the specified ID, value, and options.LdapAttribute(String id, Object value, Collection<String> options, boolean ordered) Creates an attribute with the specified ID, value, and options whose values may be ordered.LdapAttribute(String id, Collection<String> options, boolean ordered) Creates an attribute with the specified ID and options whose values may be ordered. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAllOptions(Collection<String> options) Add all values in the collection to the options.booleanAdd an option.voidClears all stored options.booleanChecks for existence of a particular option on the set.booleancontainsAll(Collection<String> options) Checks for existence of a series of options on the set.Get options.booleanTests for the presence of options.booleanremoveAllOptions(Collection<String> options) Removes all options listed in the supplied set.booleanremoveOption(String option) Removes an option from the the set.booleanretainAllOptions(Collection<String> options) Removes any options not on the set of supplied options.voidsetOptions(Set<String> options) Set options.
-
Field Details
-
options
Holds the attributes options.
-
-
Constructor Details
-
LdapAttribute
Creates an unordered attribute with the specified ID.- Parameters:
id-StringID of the attribute.
-
LdapAttribute
Creates an unordered attribute with the specified ID and value.- Parameters:
id-StringID of the attribute.value- Attribute value.
-
LdapAttribute
Creates an unordered attribute with the specified ID, value, and options.- Parameters:
id-StringID of the attribute.value- Attribute value.options-CollectionofStringattribute options.
-
LdapAttribute
Creates an attribute with the specified ID whose values may be ordered.- Parameters:
id-StringID of the attribute.ordered- boolean indicating whether or not the attributes values are ordered.
-
LdapAttribute
Creates an attribute with the specified ID and options whose values may be ordered.- Parameters:
id-StringID of the attribute.options-CollectionofStringattribute options.ordered- boolean indicating whether or not the attributes values are ordered.
-
LdapAttribute
Creates an attribute with the specified ID and value whose values may be ordered.- Parameters:
id-StringID of the attribute.value- Attribute value.ordered- boolean indicating whether or not the attributes values are ordered.
-
LdapAttribute
Creates an attribute with the specified ID, value, and options whose values may be ordered.- Parameters:
id-StringID of the attribute.value- Attribute value.options-CollectionofStringattribute options.ordered- boolean indicating whether or not the attributes values are ordered.
-
-
Method Details
-
getOptions
Get options. -
setOptions
Set options. -
addOption
Add an option.- Parameters:
option-Stringoption.- Returns:
- boolean indication successful addition of option.
-
addAllOptions
Add all values in the collection to the options.- Parameters:
options-CollectionofStringvalues.- Returns:
- boolean indication successful addition of options.
-
clearOptions
public void clearOptions()Clears all stored options. -
contains
Checks for existence of a particular option on the set.- Parameters:
option-Stringoption.- Returns:
- boolean indicating result.
-
containsAll
Checks for existence of a series of options on the set.- Parameters:
options-CollectionofStringoptions.- Returns:
- boolean indicating result.
-
hasOptions
public boolean hasOptions()Tests for the presence of options.- Returns:
- boolean indicating result.
-
removeOption
Removes an option from the the set.- Parameters:
option-Stringoption.- Returns:
- boolean indicating successful removal of option.
-
removeAllOptions
Removes all options listed in the supplied set.- Parameters:
options-CollectionofStringoptions.- Returns:
- boolean indicating successful removal of options.
-
retainAllOptions
Removes any options not on the set of supplied options.- Parameters:
options-CollectionofStringoptions.- Returns:
- boolean indicating successful retention of options.
-