org.apache.directory.shared.ldap.name
Class AttributeTypeAndValue

java.lang.Object
  extended byorg.apache.directory.shared.ldap.name.AttributeTypeAndValue
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

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

A Attribute Type And Value, which is the basis of all RDN. It contains a type, and a value. The type must not be case sensitive. Superfluous leading and trailing spaces MUST have been trimmed before. The value MUST be in UTF8 format, according to RFC 2253. If the type is in OID form, then the value must be a hexadecimal string prefixed by a '#' character. Otherwise, the string must respect the RC 2253 grammar. No further normalization will be done, because we don't have any knowledge of the Schema definition in the parser.

Author:
Apache Directory Project
See Also:
Serialized Form

Constructor Summary
AttributeTypeAndValue()
          Construct an empty AttributeTypeAndValue
AttributeTypeAndValue(java.lang.String type, java.lang.String value)
          Construct an AttributeTypeAndValue.
 
Method Summary
 java.lang.Object clone()
          Implements the cloning.
 int compareTo(java.lang.Object object)
          Compares two NameComponents.
 int compareToIgnoreCase(java.lang.Object object)
          Compares two NameComponents.
 java.lang.String getType()
          Get the type of a AttributeTypeAndValue
 java.lang.String getValue()
          Get the Value of a AttributeTypeAndValue
 java.lang.String normalize()
          A Normalized String representation of a AttributeTypeAndValue : - type is trimed and lowercased - value is trimed and lowercased
 void setType(java.lang.String type)
          Store the type
 void setTypeNormalized(java.lang.String type)
          Store the type, after having trimmed and lowercased it.
 void setValue(java.lang.String value)
          Store the value of a AttributeTypeAndValue.
 void setValueNormalized(java.lang.String value)
          Store the value of a AttributeTypeAndValue, after having trimmed it.
 java.lang.String toString()
          A String representation of a AttributeTypeAndValue.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeTypeAndValue

public AttributeTypeAndValue()
Construct an empty AttributeTypeAndValue


AttributeTypeAndValue

public AttributeTypeAndValue(java.lang.String type,
                             java.lang.String value)
                      throws javax.naming.InvalidNameException
Construct an AttributeTypeAndValue. The type and value are normalized : - the type is trimmed and lowercased - the value is trimmed

Parameters:
type - The type
value - the value
Method Detail

getType

public java.lang.String getType()
Get the type of a AttributeTypeAndValue

Returns:
The type

setType

public void setType(java.lang.String type)
             throws javax.naming.InvalidNameException
Store the type

Parameters:
type - The AttributeTypeAndValue type
Throws:
javax.naming.InvalidNameException

setTypeNormalized

public void setTypeNormalized(java.lang.String type)
                       throws javax.naming.InvalidNameException
Store the type, after having trimmed and lowercased it.

Parameters:
type - The AttributeTypeAndValue type
Throws:
javax.naming.InvalidNameException

getValue

public java.lang.String getValue()
Get the Value of a AttributeTypeAndValue

Returns:
The value

setValue

public void setValue(java.lang.String value)
Store the value of a AttributeTypeAndValue.

Parameters:
value - The value of the AttributeTypeAndValue

setValueNormalized

public void setValueNormalized(java.lang.String value)
Store the value of a AttributeTypeAndValue, after having trimmed it.

Parameters:
value - The value of the AttributeTypeAndValue

clone

public java.lang.Object clone()
Implements the cloning.

Returns:
a clone of this object

compareTo

public int compareTo(java.lang.Object object)
Compares two NameComponents. They are equals if : - types are equals, case insensitive, - values are equals, case sensitive

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object -
Returns:
0 if both NC are equals, otherwise a positive value if the original NC is superior to the second one, a negative value if the second NC is superior.

compareToIgnoreCase

public int compareToIgnoreCase(java.lang.Object object)
Compares two NameComponents. They are equals if : - types are equals, case insensitive, - values are equals, case insensitive

Parameters:
object -
Returns:
0 if both NC are equals, otherwise a positive value if the original NC is superior to the second one, a negative value if the second NC is superior.

normalize

public java.lang.String normalize()
A Normalized String representation of a AttributeTypeAndValue : - type is trimed and lowercased - value is trimed and lowercased

Returns:
A normalized string representing a AttributeTypeAndValue

toString

public java.lang.String toString()
A String representation of a AttributeTypeAndValue.

Returns:
A string representing a AttributeTypeAndValue


Copyright © 2003-2006 . All Rights Reserved.