org.springframework.ldap.core
Class LdapRdnComponent

java.lang.Object
  extended by org.springframework.ldap.core.LdapRdnComponent
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class LdapRdnComponent
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

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
See Also:
Serialized Form

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()
          Get a String representation of this instance for use in URLs.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getKey()
          Get the key (Attribute name) of this component.
 java.lang.String getLdapEncoded()
           
 java.lang.String getValue()
          Get the (Attribute) value of this component.
 int hashCode()
           
 void setKey(java.lang.String key)
          Set the key (Attribute name) of this component.
 void setValue(java.lang.String value)
          Set the (Attribute) value of this component.
 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()
Get the key (Attribute name) of this component.

Returns:
the key.

setKey

public void setKey(java.lang.String key)
Set the key (Attribute name) of this component.

Parameters:
key - the key.

getValue

public java.lang.String getValue()
Get the (Attribute) value of this component.

Returns:
the value.

setValue

public void setValue(java.lang.String value)
Set the (Attribute) value of this component.

Parameters:
value - the value.

encodeLdap

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

Returns:
Properly ldap escaped 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()
Get a String representation of this instance for use in URLs.

Returns:
a properly URL encoded representation of this instancs.

hashCode

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

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.