Class RDn

java.lang.Object
org.ldaptive.dn.RDn

public class RDn extends 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.
  • Field Details

    • HASH_CODE_SEED

      private static final int HASH_CODE_SEED
      hash code seed.
      See Also:
    • nameValues

      private final Set<NameValue> nameValues
      Name value pairs.
  • Constructor Details

    • RDn

      public RDn(String rdn)
      Creates a new RDN with the supplied string.
      Parameters:
      rdn - to parse
      Throws:
      IllegalArgumentException - if rdn contains multiple RDNs or no RDNs
    • RDn

      public RDn(String rdn, DnParser parser)
      Creates a new RDN with the supplied string.
      Parameters:
      rdn - to parse
      parser - to parse dn
      Throws:
      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(Collection<NameValue> values)
      Creates a new RDN with the supplied name value pairs.
      Parameters:
      values - to add
    • RDn

      public RDn(String attributeName, String attributeValue)
      Creates a new RDN with a single name value pair.
      Parameters:
      attributeName - to add
      attributeValue - to add
  • Method Details

    • getNameValue

      public NameValue getNameValue()
      Returns the first name value pair in this RDN.
      Returns:
      name value pair
    • getNameValues

      public Set<NameValue> getNameValues()
      Returns all the name value pairs in this RDN.
      Returns:
      name value paris
    • getNameValues

      public Set<NameValue> getNameValues(String name)
      Returns the name values that match the supplied name.
      Parameters:
      name - to match
      Returns:
      name values
    • getNameValue

      public NameValue getNameValue(String name)
      Returns a single name value that matches the supplied name. See getNameValues(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 String format()
      Returns a string representation of this RDN, joining each name value pair with '+'.
      Returns:
      string form of the RDN
    • format

      public 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(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object