Package org.ldaptive.dn
Class NameValue
- java.lang.Object
-
- org.ldaptive.dn.NameValue
-
public final class NameValue extends Object
Container for a RDN name value pair.
-
-
Field Summary
Fields Modifier and Type Field Description private StringattributeNameAttribute name.private byte[]attributeValueAttribute value.private static intHASH_CODE_SEEDhash code seed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Stringformat()Returns a string representation of this name value, of the form 'name=value'.byte[]getBinaryValue()StringgetName()Returns the attribute name.StringgetStringValue()<T> TgetValue(Function<byte[],T> func)inthashCode()booleanhasName(String name)Returns whether the attribute name matches the supplied name.StringtoString()
-
-
-
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 byte[] 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
-
-