T - type of valuesprivate class LdapAttribute.LdapAttributeValues<T>
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private static int |
HASH_CODE_SEED
hash code seed.
|
private static long |
serialVersionUID
serial version uid.
|
private java.lang.Class<T> |
type
Type of values.
|
private java.util.Collection<T> |
values
Collection of values.
|
| Constructor and Description |
|---|
LdapAttributeValues(java.lang.Class<T> t)
Creates a new ldap attribute values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Object o)
Adds the supplied object to this values.
|
private void |
checkValue(java.lang.Object o)
Determines if the supplied object is acceptable to use in this values.
|
void |
clear()
Removes all the values.
|
protected java.util.Collection<byte[]> |
convertValuesToByteArray(java.util.Collection<java.lang.String> v)
UTF-8 encodes the supplied collection of values.
|
protected java.util.Collection<java.lang.String> |
convertValuesToString(java.util.Collection<byte[]> v)
Base64 encodes the supplied collection of values.
|
java.util.Collection<byte[]> |
getBinaryValues()
Returns the values in binary format.
|
java.util.Collection<java.lang.String> |
getStringValues()
Returns the values in string format.
|
int |
hashCode() |
boolean |
isType(java.lang.Class<?> c)
Returns whether this ldap attribute values is of the supplied type.
|
void |
remove(java.lang.Object o)
Removes the supplied object from this values if it exists.
|
int |
size()
Returns the number of values.
|
java.lang.String |
toString() |
private static final int HASH_CODE_SEED
private static final long serialVersionUID
private final java.lang.Class<T> type
private final java.util.Collection<T> values
public LdapAttributeValues(java.lang.Class<T> t)
t - type of valuesjava.lang.IllegalArgumentException - if t is not a String or byte[]public boolean isType(java.lang.Class<?> c)
c - type to checkpublic java.util.Collection<java.lang.String> getStringValues()
convertValuesToString(Collection).public java.util.Collection<byte[]> getBinaryValues()
convertValuesToByteArray(Collection).public void add(java.lang.Object o)
o - to addjava.lang.IllegalArgumentException - if o is null or if o is not the correct typepublic void remove(java.lang.Object o)
o - to removejava.lang.IllegalArgumentException - if o is null or if o is not the correct typeprivate void checkValue(java.lang.Object o)
o - object to checkjava.lang.IllegalArgumentException - if o is null or if o is not the correct typepublic int size()
public void clear()
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectprotected java.util.Collection<java.lang.String> convertValuesToString(java.util.Collection<byte[]> v)
v - values to encodeprotected java.util.Collection<byte[]> convertValuesToByteArray(java.util.Collection<java.lang.String> v)
v - values to encode