Package org.ldaptive.dn
Class RDn
- java.lang.Object
-
- org.ldaptive.dn.RDn
-
public class RDn extends java.lang.Object
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.- Author:
- Middleware Services
-
-
Constructor Summary
Constructors Constructor Description RDn(java.lang.String rdn)
Creates a new RDN with the supplied string.RDn(java.lang.String attributeName, java.lang.String attributeValue)
Creates a new RDN with a single name value pair.RDn(java.lang.String rdn, DnParser parser)
Creates a new RDN with the supplied string.RDn(java.util.Collection<NameValue> values)
Creates a new RDN with the supplied name value pairs.RDn(NameValue... value)
Creates a new RDN with the supplied name value pairs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
format()
Returns a string representation of this RDN, joining each name value pair with '+'.java.lang.String
format(RDnNormalizer normalizer)
Returns a string representation of this RDN, joining each name value pair with '+'.NameValue
getNameValue()
Returns the first name value pair in this RDN.NameValue
getNameValue(java.lang.String name)
Returns a single name value that matches the supplied name.java.util.Set<NameValue>
getNameValues()
Returns all the name value pairs in this RDN.java.util.Set<NameValue>
getNameValues(java.lang.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.java.lang.String
toString()
-
-
-
Constructor Detail
-
RDn
public RDn(java.lang.String rdn)
Creates a new RDN with the supplied string.- Parameters:
rdn
- to parse- Throws:
java.lang.IllegalArgumentException
- if rdn contains multiple RDNs or no RDNs
-
RDn
public RDn(java.lang.String rdn, DnParser parser)
Creates a new RDN with the supplied string.- Parameters:
rdn
- to parseparser
- to parse dn- Throws:
java.lang.IllegalArgumentException
- if rdn contains multiple RDNs or no RDNS
-
RDn
public RDn(NameValue... value)
Creates a new RDN with the supplied name value pairs.- Parameters:
value
- to add
-
RDn
public RDn(java.util.Collection<NameValue> values)
Creates a new RDN with the supplied name value pairs.- Parameters:
values
- to add
-
RDn
public RDn(java.lang.String attributeName, java.lang.String attributeValue)
Creates a new RDN with a single name value pair.- Parameters:
attributeName
- to addattributeValue
- to add
-
-
Method Detail
-
getNameValue
public NameValue getNameValue()
Returns the first name value pair in this RDN.- Returns:
- name value pair
-
getNameValues
public java.util.Set<NameValue> getNameValues()
Returns all the name value pairs in this RDN.- Returns:
- name value paris
-
getNameValues
public java.util.Set<NameValue> getNameValues(java.lang.String name)
Returns the name values that match the supplied name.- Parameters:
name
- to match- Returns:
- name values
-
getNameValue
public NameValue getNameValue(java.lang.String name)
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
public java.lang.String format()
Returns a string representation of this RDN, joining each name value pair with '+'.- Returns:
- string form of the RDN
-
format
public java.lang.String format(RDnNormalizer normalizer)
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
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-