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 int
hash 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 TypeMethodDescriptionboolean
format()
Returns a string representation of this RDN, joining each name value pair with '+'.format
(RDnNormalizer normalizer) Returns a string representation of this RDN, joining each name value pair with '+'.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.int
hashCode()
int
size()
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
-
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
-
format
Returns a string representation of this RDN, joining each name value pair with '+'.- 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
-