org.springframework.ldap.support
Class LdapRdnComponent

java.lang.Object
  extended by org.springframework.ldap.support.LdapRdnComponent
All Implemented Interfaces:
java.lang.Comparable

public class LdapRdnComponent
extends java.lang.Object
implements java.lang.Comparable

Represents part of an LdapRdn. As specified in RFC2253 an LdapRdn may be composed of several attributes, separated by "+". An LdapRdnComponent represents one of these attributes.

Author:
Mattias Arthursson

Field Summary
static boolean DONT_DECODE_VALUE
           
 
Constructor Summary
LdapRdnComponent(java.lang.String key, java.lang.String value)
          Constructs an LdapRdnComponent without decoding the value.
LdapRdnComponent(java.lang.String key, java.lang.String value, boolean decodeValue)
          Constructs an LdapRdnComponent, optionally decoding the value.
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compare this instance to the supplied object.
protected  java.lang.String encodeLdap()
          Encode key and value to ldap
 java.lang.String encodeUrl()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getKey()
           
 java.lang.String getLdapEncoded()
           
 java.lang.String getValue()
           
 int hashCode()
           
 void setKey(java.lang.String key)
           
 void setValue(java.lang.String value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DONT_DECODE_VALUE

public static final boolean DONT_DECODE_VALUE
See Also:
Constant Field Values
Constructor Detail

LdapRdnComponent

public LdapRdnComponent(java.lang.String key,
                        java.lang.String value)
Constructs an LdapRdnComponent without decoding the value.

Parameters:
key - the Atttribute name.
value - the Attribute value.

LdapRdnComponent

public LdapRdnComponent(java.lang.String key,
                        java.lang.String value,
                        boolean decodeValue)
Constructs an LdapRdnComponent, optionally decoding the value.

Parameters:
key - the Atttribute name.
value - the Attribute value.
decodeValue - if true the value is decoded (typically used when a DN is parsed from a String), otherwise the value is used as specified.
Method Detail

getKey

public java.lang.String getKey()

setKey

public void setKey(java.lang.String key)

getValue

public java.lang.String getValue()

setValue

public void setValue(java.lang.String value)

encodeLdap

protected java.lang.String encodeLdap()
Encode key and value to ldap

Returns:
The ldap encoded rdn

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getLdapEncoded

public java.lang.String getLdapEncoded()
Returns:
The LdapRdn as a string where the value is LDAP-encoded.

encodeUrl

public java.lang.String encodeUrl()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object obj)
Compare this instance to the supplied object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the object to compare to.
Throws:
java.lang.ClassCastException - if the object is not possible to cast to an LdapRdnComponent.


Copyright � 2002-2006. All Rights Reserved.