Package org.ldaptive.dn
Class RDn
java.lang.Object
org.ldaptive.dn.RDn
Relative distinguished name containing one or more name value pairs. Name value pairs are ordered from left to right
such that the left-most pair is considered the first. For the RDN 'cn=Jane Doe+mail=jdoe@example.com', the first name
value pair is 'cn=Jane Doe'.
See RFC 4514 for more details on the string representations of
RDNs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final inthash code seed.Name value pairs. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new RDN with the supplied string.Creates a new RDN with a single name value pair.Creates a new RDN with the supplied string.RDn(Collection<NameValue> values) Creates a new RDN with the supplied name value pairs.Creates a new RDN with the supplied name value pairs. -
Method Summary
Modifier and TypeMethodDescriptionbooleanformat()Returns a string representation of this RDN.format(RDnNormalizer normalizer) Returns a string representation of this RDN, joining each name value pair with '+'.getNames()Returns all the names in this RDN.Returns the first name value pair in this RDN.getNameValue(String name) Returns a single name value that matches the supplied name.Returns all the name value pairs in this RDN.getNameValues(String name) Returns the name values that match the supplied name.inthashCode()booleanisEmpty()Returns whether this RDN contains any name values.booleanReturns whether the normalized format of the supplied RDN equals the normalized format of this RDN.booleanisSame(RDn rdn, RDnNormalizer normalizer) Returns whether the normalized format of the supplied RDN equals the normalized format of this RDN.intsize()Returns the number of name value pairs in this RDN.toString()
-
Field Details
-
HASH_CODE_SEED
private static final int HASH_CODE_SEEDhash code seed.- See Also:
-
nameValues
Name value pairs.
-
-
Constructor Details
-
RDn
Creates a new RDN with the supplied string.- Parameters:
rdn- to parse- Throws:
IllegalArgumentException- if rdn contains multiple RDNs or no RDNs
-
RDn
Creates a new RDN with the supplied string.- Parameters:
rdn- to parseparser- to parse dn- Throws:
IllegalArgumentException- if rdn contains multiple RDNs or no RDNS
-
RDn
Creates a new RDN with the supplied name value pairs.- Parameters:
value- to add
-
RDn
Creates a new RDN with the supplied name value pairs.- Parameters:
values- to add
-
RDn
Creates a new RDN with a single name value pair.- Parameters:
attributeName- to addattributeValue- to add
-
-
Method Details
-
getNameValue
Returns the first name value pair in this RDN.- Returns:
- name value pair
-
getNameValues
Returns all the name value pairs in this RDN.- Returns:
- name value paris
-
getNames
Returns all the names in this RDN.- Returns:
- all names
-
getNameValues
Returns the name values that match the supplied name.- Parameters:
name- to match- Returns:
- name values
-
getNameValue
Returns a single name value that matches the supplied name. SeegetNameValues(String).- Parameters:
name- to match- Returns:
- name value
-
size
public int size()Returns the number of name value pairs in this RDN.- Returns:
- RDN size
-
isEmpty
public boolean isEmpty()Returns whether this RDN contains any name values.- Returns:
- whether this RDN contains any name values
-
isSame
Returns whether the normalized format of the supplied RDN equals the normalized format of this RDN. SeeDefaultRDnNormalizer.- Parameters:
rdn- to compare- Returns:
- whether the supplied RDN is the same as this RDN
-
isSame
Returns whether the normalized format of the supplied RDN equals the normalized format of this RDN.- Parameters:
normalizer- to use for comparisonrdn- to compare- Returns:
- whether the supplied RDN is the same as this RDN
-
format
Returns a string representation of this RDN. Uses aDefaultRDnNormalizerby default.- Returns:
- string form of the RDN
-
format
Returns a string representation of this RDN, joining each name value pair with '+'.- Parameters:
normalizer- to apply to the RDN components or null for no formatting- Returns:
- string form of the RDN
-
equals
-
hashCode
public int hashCode() -
toString
-