|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.AbstractLdapBean
org.ldaptive.LdapAttribute
public class LdapAttribute
Simple bean representing an ldap attribute. Contains a name and a collection of values.
| Constructor Summary | |
|---|---|
LdapAttribute()
Default constructor. |
|
LdapAttribute(boolean binary)
Creates a new ldap attribute. |
|
LdapAttribute(SortBehavior sb)
Creates a new ldap attribute. |
|
LdapAttribute(SortBehavior sb,
boolean binary)
Creates a new ldap attribute. |
|
LdapAttribute(String name)
Creates a new ldap attribute. |
|
LdapAttribute(String name,
byte[]... values)
Creates a new ldap attribute. |
|
LdapAttribute(String name,
String... values)
Creates a new ldap attribute. |
|
| Method Summary | ||
|---|---|---|
void |
addBinaryValue(byte[]... value)
Adds the supplied byte array as a value for this attribute. |
|
void |
addBinaryValues(Collection<byte[]> values)
Adds all the byte arrays in the supplied collection as values for this attribute. |
|
void |
addStringValue(String... value)
Adds the supplied string as a value for this attribute. |
|
void |
addStringValues(Collection<String> values)
Adds all the strings in the supplied collection as values for this attribute. |
|
|
addValue(ValueTranscoder<T> transcoder,
T... value)
Adds the supplied values for this attribute by encoding them with the supplied transcoder. |
|
|
addValues(ValueTranscoder<T> transcoder,
Collection<T> values)
Adds all the values in the supplied collection for this attribute by encoding them with the supplied transcoder. |
|
void |
clear()
Removes all the values in this ldap attribute. |
|
static LdapAttribute |
createLdapAttribute(SortBehavior sb,
String name,
Collection<Object> values)
Creates a new ldap attribute. |
|
protected
|
createSortBehaviorCollection(Class<E> c)
Returns an implementation of collection for the sort behavior of this bean. |
|
boolean |
equals(Object o)
|
|
static String |
escapeValue(String value)
Escapes the supplied string value per RFC 4514 section 2.4. |
|
byte[] |
getBinaryValue()
Returns a single byte array value of this attribute. |
|
Collection<byte[]> |
getBinaryValues()
Returns the values of this attribute as byte arrays. |
|
String |
getName()
Returns the name of this attribute. |
|
String |
getName(boolean withOptions)
Returns the name of this attribute with or without options. |
|
String[] |
getOptions()
Returns the options for this attribute. |
|
String |
getStringValue()
Returns a single string value of this attribute. |
|
Collection<String> |
getStringValues()
Returns the values of this attribute as strings. |
|
|
getValue(ValueTranscoder<T> transcoder)
Returns a single decoded value of this attribute. |
|
|
getValues(ValueTranscoder<T> transcoder)
Returns the values of this attribute decoded by the supplied transcoder. |
|
int |
hashCode()
|
|
boolean |
isBinary()
Returns whether this ldap attribute contains a value of type byte[]. |
|
void |
removeBinaryValue(byte[]... value)
Removes the supplied value from the attribute values if it exists. |
|
void |
removeBinaryValues(Collection<byte[]> values)
Removes the supplied values from the attribute values if they exists. |
|
void |
removeStringValue(String... value)
Removes the supplied value from the attribute values if it exists. |
|
void |
removeStringValues(Collection<String> values)
Removes the supplied values from the attribute values if they exists. |
|
void |
setName(String name)
Sets the name of this attribute. |
|
int |
size()
Returns the number of values in this ldap attribute. |
|
String |
toString()
|
|
| Methods inherited from class org.ldaptive.AbstractLdapBean |
|---|
getSortBehavior |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LdapAttribute()
public LdapAttribute(SortBehavior sb)
sb - sort behavior of this attributepublic LdapAttribute(boolean binary)
binary - whether this attribute contains binary values
public LdapAttribute(SortBehavior sb,
boolean binary)
sb - sort behavior of this attributebinary - whether this attribute contains binary valuespublic LdapAttribute(String name)
name - of this attribute
public LdapAttribute(String name,
String... values)
name - of this attributevalues - of this attribute
public LdapAttribute(String name,
byte[]... values)
name - of this attributevalues - of this attribute| Method Detail |
|---|
public String getName()
public String getName(boolean withOptions)
withOptions - whether options should be included in the name
public void setName(String name)
name - to setpublic String[] getOptions()
public Collection<String> getStringValues()
public String getStringValue()
getStringValues().
public Collection<byte[]> getBinaryValues()
public byte[] getBinaryValue()
getBinaryValues().
public boolean isBinary()
public <T> Collection<T> getValues(ValueTranscoder<T> transcoder)
T - type of decoded attributestranscoder - to decode attribute values with
public <T> T getValue(ValueTranscoder<T> transcoder)
getValues(ValueTranscoder).
T - type of decoded attributestranscoder - to decode attribute values with
public void addStringValue(String... value)
value - to add
NullPointerException - if value is nullpublic void addStringValues(Collection<String> values)
addStringValue(String...).
values - to addpublic void addBinaryValue(byte[]... value)
value - to add
NullPointerException - if value is nullpublic void addBinaryValues(Collection<byte[]> values)
addBinaryValue(byte[][]).
values - to add
public <T> void addValue(ValueTranscoder<T> transcoder,
T... value)
T - type attribute to encodetranscoder - to encode value withvalue - to encode and add
NullPointerException - if value is null
public <T> void addValues(ValueTranscoder<T> transcoder,
Collection<T> values)
addValue(ValueTranscoder, Object...).
T - type attribute to encodetranscoder - to encode value withvalues - to encode and addpublic void removeStringValue(String... value)
value - to removepublic void removeStringValues(Collection<String> values)
removeStringValue(String...).
values - to removepublic void removeBinaryValue(byte[]... value)
value - to removepublic void removeBinaryValues(Collection<byte[]> values)
removeBinaryValue(byte[][]).
values - to removepublic int size()
public void clear()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectprotected <E> Collection<E> createSortBehaviorCollection(Class<E> c)
SortBehavior.UNORDERED,
LinkedHashSet for SortBehavior.ORDERED, and TreeSet for SortBehavior.SORTED.
E - contained in the collectionc - type contained in the collection
public static LdapAttribute createLdapAttribute(SortBehavior sb,
String name,
Collection<Object> values)
sb - sort behaviorname - of this attributevalues - of this attribute
IllegalArgumentException - if values contains something other than
String or byte[]public static String escapeValue(String value)
value - to escape
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||