org.springframework.ldap.core

## Class LdapRdn

- java.lang.Object
- - org.springframework.ldap.core.LdapRdn

- All Implemented Interfaces:
    Serializable, Comparable

  Deprecated.
  `DistinguishedName` and associated classes are deprecated as of 2.0.

      public class LdapRdn
      extends Object
      implements Serializable, Comparable

  Datatype for a LDAP name, a part of a path. The name: uid=adam.skogman Key: uid Value: adam.skogman
  Author:
    Adam Skogman, Mattias Hellborg Arthursson
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LdapRdn()` Deprecated. Default constructor.
    `LdapRdn(String string)` Deprecated. Parse the supplied string and construct this instance accordingly.
    `LdapRdn(String key, String value)` Deprecated. Construct an LdapRdn using the supplied key and value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addComponent(LdapRdnComponent rdnComponent)` Deprecated. Add an LdapRdnComponent to this LdapRdn.
    `int` | `compareTo(Object obj)` Deprecated. Compare this LdapRdn to another object.
    `String` | `encodeUrl()` Deprecated. Get a String representation of this LdapRdn for use in urls.
    `boolean` | `equals(Object obj)` Deprecated.
    `LdapRdnComponent` | `getComponent()` Deprecated. Gets the first LdapRdnComponent of this LdapRdn.
    `LdapRdnComponent` | `getComponent(int idx)` Deprecated. Get the LdapRdnComponent at index `idx`.
    `List` | `getComponents()` Deprecated. Gets all components in this LdapRdn.
    `String` | `getKey()` Deprecated. Get the key of this LdapRdn.
    `String` | `getLdapEncoded()` Deprecated. Get a properly rfc2253-encoded String representation of this LdapRdn.
    `String` | `getValue()` Deprecated. Get the value of this LdapRdn.
    `String` | `getValue(String key)` Deprecated. Get the value of the LdapComponent with the specified key (Attribute name).
    `int` | `hashCode()` Deprecated.
    `LdapRdn` | `immutableLdapRdn()` Deprecated. Create an immutable copy of this instance.
    `String` | `toString()` Deprecated.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LdapRdn

          public LdapRdn()

      Deprecated.
      Default constructor. Create an empty, uninitialized LdapRdn.

    - #### LdapRdn

          public LdapRdn(String string)

      Deprecated.
      Parse the supplied string and construct this instance accordingly.
      Parameters:
        `string` - the string to parse.

    - #### LdapRdn

          public LdapRdn(String key,
                         String value)

      Deprecated.
      Construct an LdapRdn using the supplied key and value.
      Parameters:
        `key` - the attribute name.
        `value` - the attribute value.

  - ### Method Detail

    - #### addComponent

          public void addComponent(LdapRdnComponent rdnComponent)

      Deprecated.
      Add an LdapRdnComponent to this LdapRdn.
      Parameters:
        `rdnComponent` - the LdapRdnComponent to add.s

    - #### getComponents

          public List getComponents()

      Deprecated.
      Gets all components in this LdapRdn.
      Returns:
        the List of all LdapRdnComponents composing this LdapRdn.

    - #### getComponent

          public LdapRdnComponent getComponent()

      Deprecated.
      Gets the first LdapRdnComponent of this LdapRdn.
      Returns:
        The first LdapRdnComponent of this LdapRdn.
      Throws:
        `IndexOutOfBoundsException` - if there are no components in this Rdn.

    - #### getComponent

          public LdapRdnComponent getComponent(int idx)

      Deprecated.
      Get the LdapRdnComponent at index `idx`.
      Parameters:
        `idx` - the 0-based index of the component to get.
      Returns:
        the LdapRdnComponent at index `idx`.
      Throws:
        `IndexOutOfBoundsException` - if there are no components in this Rdn.

    - #### getLdapEncoded

          public String getLdapEncoded()

      Deprecated.
      Get a properly rfc2253-encoded String representation of this LdapRdn.
      Returns:
        an escaped String corresponding to this LdapRdn.
      Throws:
        `IndexOutOfBoundsException` - if there are no components in this Rdn.

    - #### encodeUrl

          public String encodeUrl()

      Deprecated.
      Get a String representation of this LdapRdn for use in urls.
      Returns:
        a String representation of this LdapRdn for use in urls.

    - #### compareTo

          public int compareTo(Object obj)

      Deprecated.
      Compare this LdapRdn to another object.
      Specified by:
        `compareTo` in interface `Comparable`
      Parameters:
        `obj` - the object to compare to.
      Throws:
        `ClassCastException` - if the supplied object is not an LdapRdn instance.

    - #### equals

          public boolean equals(Object obj)

      Deprecated.
      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Deprecated.
      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Deprecated.
      Overrides:
        `toString` in class `Object`

    - #### getValue

          public String getValue()

      Deprecated.
      Get the value of this LdapRdn. Note that if this Rdn is multi-value the first value will be returned. E.g. for the Rdn `cn=john doe+sn=doe`, the return value would be `john doe`.
      Returns:
        the (first) value of this LdapRdn.
      Throws:
        `IndexOutOfBoundsException` - if there are no components in this Rdn.

    - #### getKey

          public String getKey()

      Deprecated.
      Get the key of this LdapRdn. Note that if this Rdn is multi-value the first key will be returned. E.g. for the Rdn `cn=john doe+sn=doe`, the return value would be `cn`.
      Returns:
        the (first) key of this LdapRdn.
      Throws:
        `IndexOutOfBoundsException` - if there are no components in this Rdn.

    - #### getValue

          public String getValue(String key)

      Deprecated.
      Get the value of the LdapComponent with the specified key (Attribute name).
      Parameters:
        `key` - the key
      Returns:
        the value.
      Throws:
        `IllegalArgumentException` - if there is no component with the specified key.

    - #### immutableLdapRdn

          public LdapRdn immutableLdapRdn()

      Deprecated.
      Create an immutable copy of this instance. It will not be possible to add or remove components or modify the keys and values of these components.
      Returns:
        an immutable copy of this instance.
      Since:
        1.3