org.springframework.ldap.support
Class LdapRdn

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

public class LdapRdn
extends java.lang.Object
implements java.io.Serializable, java.lang.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 Arthursson
See Also:
Serialized Form

Constructor Summary
LdapRdn()
          Default constructor.
LdapRdn(java.lang.String string)
          Parse the supplied string and construct this instance accordingly.
LdapRdn(java.lang.String key, java.lang.String value)
          Construct an LdapRdn using the supplied key and value.
 
Method Summary
 void addComponent(LdapRdnComponent rdnComponent)
          Add an LdapRdnComponent to this LdapRdn.
 int compareTo(java.lang.Object obj)
          Compare this LdapRdn to another object.
 java.lang.String encodeUrl()
          Get a String representation of this LdapRdn for use in urls.
 boolean equals(java.lang.Object obj)
           
 LdapRdnComponent getComponent()
          Gets the first LdapRdnComponent of this LdapRdn.
 LdapRdnComponent getComponent(int idx)
          Get the LdapRdnComponent at index idx.
 java.util.List getComponents()
          Gets all components in this LdapRdn.
 java.lang.String getLdapEncoded()
          Get a properly rfc2253-encoded String representation to this LdapRdn.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LdapRdn

public LdapRdn()
Default constructor.


LdapRdn

public LdapRdn(java.lang.String string)
Parse the supplied string and construct this instance accordingly.

Parameters:
string - the string to parse.

LdapRdn

public LdapRdn(java.lang.String key,
               java.lang.String value)
Construct an LdapRdn using the supplied key and value.

Parameters:
key -
value -
Method Detail

addComponent

public void addComponent(LdapRdnComponent rdnComponent)
Add an LdapRdnComponent to this LdapRdn.

Parameters:
rdnComponent - the LdapRdnComponent to add.s

getComponents

public java.util.List getComponents()
Gets all components in this LdapRdn.

Returns:
the List of all LdapRdnComponents composing this LdapRdn.

getComponent

public LdapRdnComponent getComponent()
Gets the first LdapRdnComponent of this LdapRdn.

Returns:
The first LdapRdnComponent of this LdapRdn.
Throws:
java.lang.IndexOutOfBoundsException - if no components have been added.

getComponent

public LdapRdnComponent getComponent(int idx)
Get the LdapRdnComponent at index idx.

Parameters:
idx - the 0-based index of the component to get.
Returns:
the LdapRdnComponent at indet idx.
Throws:
java.lang.IndexOutOfBoundsException - if no component exists at index idx.

getLdapEncoded

public java.lang.String getLdapEncoded()
Get a properly rfc2253-encoded String representation to this LdapRdn.

Returns:
an encoded String corresponding to this LdapRdn.

encodeUrl

public java.lang.String encodeUrl()
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(java.lang.Object obj)
Compare this LdapRdn to another object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the object to compare to.
Throws:
java.lang.ClassCastException - if the supplied object is not an LdapRdn instance.

equals

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

hashCode

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

toString

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


Copyright � 2002-2006. All Rights Reserved.