Package org.ldaptive.dn
Class NameValue
- java.lang.Object
-
- org.ldaptive.dn.NameValue
-
public class NameValue extends Object
Container for a RDN name value pair.
-
-
Field Summary
Fields Modifier and Type Field Description private String
attributeName
Attribute name.private ByteBuffer
attributeValue
Attribute value.private static int
HASH_CODE_SEED
hash code seed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
format()
Returns a string representation of this name value, of the form 'name=value'.byte[]
getBinaryValue()
String
getName()
Returns the attribute name.String
getStringValue()
<T> T
getValue(Function<byte[],T> func)
int
hashCode()
boolean
hasName(String name)
Returns whether the attribute name matches the supplied name.String
toString()
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
attributeName
private final String attributeName
Attribute name.
-
attributeValue
private final ByteBuffer attributeValue
Attribute value.
-
-
Constructor Detail
-
NameValue
public NameValue(String name, String value)
Creates a new name value.- Parameters:
name
- of the attributevalue
- of the attribute
-
NameValue
public NameValue(String name, byte[] value)
Creates a new name value.- Parameters:
name
- of the attributevalue
- of the attribute
-
-
Method Detail
-
getName
public String getName()
Returns the attribute name.- Returns:
- attribute name
-
getBinaryValue
public byte[] getBinaryValue()
-
getStringValue
public String getStringValue()
-
getValue
public <T> T getValue(Function<byte[],T> func)
-
hasName
public boolean hasName(String name)
Returns whether the attribute name matches the supplied name.- Parameters:
name
- to match- Returns:
- whether name matches the attribute name
-
format
public String format()
Returns a string representation of this name value, of the form 'name=value'.- Returns:
- string form of the name value pair
-
-