Interface LDAPAttribute
-
public interface LDAPAttribute
Represents a data structure for holding information about an LDAP attribute, which includes an attribute name (which may include a set of attribute options) and zero or more values.- See Also:
LDAPEntry
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
equals(Object obj)
Reports whether the provided object is equal to this attribute.String
getBaseName()
Extracts the base name from the attribute name of this attribute.byte[]
getByteValue()
Returns the value of this attribute in byte[] format.byte[][]
getByteValueArray()
Returns the values of the attribute in an array of byte[] format.String
getName()
Returns the name of the attribute which may include zero or more attribute options.Set<String>
getOptions()
Returns the set of options for this attribute.Set<String>
getOptions(String attrName)
Extracts the attribute options from the specified attribute name.String
getStringValue()
Returns the string value of this attribute.String[]
getStringValueArray()
Returns the values of the attribute in an array of String objects.int
hashCode()
Returns a hash code for this attribute.boolean
hasOption(String option)
Reports whether this attribute contains the specified attribute option.boolean
hasOptions()
Reports whether this attribute has any attribute options.boolean
hasOptions(String[] options)
Reports whether this attribute contains all of the specified attribute options.boolean
hasValue()
Reports whether this attribute contains at least one value.boolean
hasValue(byte[] value)
Reports whether this attribute contains the specified value.boolean
hasValue(String value)
Reports whether this attribute contains the specified value.int
size()
Returns the number of values of this attribute.String
toString()
Returns the string representation of this attribute.
-
-
-
Method Detail
-
getBaseName
String getBaseName()
Extracts the base name from the attribute name of this attribute.- Returns:
- the attribute base name (the attribute name without any options).
- See Also:
getOptions(java.lang.String)
-
hasValue
boolean hasValue()
Reports whether this attribute contains at least one value.- Returns:
- true if this attribute has at least one value, or false if not.
-
hasValue
boolean hasValue(byte[] value)
Reports whether this attribute contains the specified value.- Parameters:
value
- the value for which to make the check. It must not be null.- Returns:
- true if the attribute has the specified value, or false if not.
-
hasValue
boolean hasValue(String value)
Reports whether this attribute contains the specified value.- Parameters:
value
- the value for which to make the check. It must not be null.- Returns:
- true if the attribute has the specified value, or false if not.
-
getByteValue
byte[] getByteValue()
Returns the value of this attribute in byte[] format.- Returns:
- the value of this attribute in byte[] format.
-
getByteValueArray
byte[][] getByteValueArray()
Returns the values of the attribute in an array of byte[] format.- Returns:
- the array of attribute values. Each element in the array will be of type byte[].
-
getName
String getName()
Returns the name of the attribute which may include zero or more attribute options.- Returns:
- the name of the attribute.
-
getStringValue
String getStringValue()
Returns the string value of this attribute.- Returns:
- the string value of this attribute.
-
getStringValueArray
String[] getStringValueArray()
Returns the values of the attribute in an array of String objects.- Returns:
- the array of attribute values. Each element in the array will be a String object.
-
hasOptions
boolean hasOptions()
Reports whether this attribute has any attribute options.- Returns:
- true if this attribute has at least one attribute option, or false if not.
-
hasOption
boolean hasOption(String option)
Reports whether this attribute contains the specified attribute option.- Parameters:
option
- the attribute option for which to make the check.- Returns:
- true if the attribute contains the specified attribute option.
-
hasOptions
boolean hasOptions(String[] options)
Reports whether this attribute contains all of the specified attribute options.- Parameters:
options
- the attribute options for which to make the check.- Returns:
- true if the attribute contains all of the specified attribute options.
-
getOptions
Set<String> getOptions()
Returns the set of options for this attribute.- Returns:
- the set of options for the attribute, or an empty set if there are none.
-
getOptions
Set<String> getOptions(String attrName)
Extracts the attribute options from the specified attribute name.- Parameters:
attrName
- attribute name from which to extract the attribute options. It must not be null.- Returns:
- set of options for the attribute name, or an empty set if there are none.
-
size
int size()
Returns the number of values of this attribute.- Returns:
- the number of values of this attribute.
-
equals
boolean equals(Object obj)
Reports whether the provided object is equal to this attribute.
-
hashCode
int hashCode()
Returns a hash code for this attribute.
-
-