public class AVA extends Object implements Cloneable, Comparable, Externalizable
Constructor and Description |
---|
AVA()
Construct an empty AVA
|
AVA(String upType,
String normType,
byte[] upValue,
byte[] normValue)
Construct an AVA.
|
AVA(String upType,
String normType,
String upValue,
String normValue)
Construct an AVA.
|
AVA(String upType,
String normType,
Value<?> upValue,
Value<?> normValue)
Construct an AVA.
|
AVA(String upType,
String normType,
Value<?> upValue,
Value<?> normValue,
String upName)
Construct an AVA.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Implements the cloning.
|
int |
compareTo(Object object)
Compares two NameComponents.
|
int |
compareToIgnoreCase(Object object)
Compares two NameComponents.
|
boolean |
equals(Object obj) |
int |
getLength()
Get the upName length
|
String |
getNormName()
Get the normalized Name of a AVA
|
String |
getNormType()
Get the normalized type of a AVA
|
Value<?> |
getNormValue()
Get the Value of a AVA
|
int |
getStart()
get the position in the original upName where this atav starts.
|
String |
getUpName()
Get the user provided form of this attribute type and value
|
String |
getUpType()
Get the user provided type of a AVA
|
Value<?> |
getUpValue()
Get the User Provided Value of a AVA
|
int |
hashCode()
Gets the hashcode of this object.
|
String |
normalize()
A Normalized String representation of a AVA :
- type is trimed and lowercased
- value is trimed and lowercased, and special characters
are escaped if needed.
|
String |
normalizeValue() |
void |
readExternal(ObjectInput in) |
void |
setType(String upType,
String type)
Store a new type
|
void |
setTypeNormalized(String type)
Store the type, after having trimmed and lowercased it.
|
void |
setValue(Value<?> upValue,
Value<?> normValue)
Store the value of a AVA.
|
void |
setValueNormalized(String value)
Store the value of a AVA, after having trimmed it.
|
String |
toString()
A String representation of a AVA.
|
void |
writeExternal(ObjectOutput out) |
public AVA()
public AVA(String upType, String normType, String upValue, String normValue) throws LdapInvalidDnException
Note that the upValue should not be null or empty, or resolved to an empty string after having trimmed it.
upType
- The Usrr Provided typenormType
- The normalized typeupValue
- The User Provided valuenormValue
- The normalized valueLdapInvalidDnException
public AVA(String upType, String normType, byte[] upValue, byte[] normValue) throws LdapInvalidDnException
Note that the upValue should not be null or empty, or resolved to an empty string after having trimmed it.
upType
- The Usrr Provided typenormType
- The normalized typeupValue
- The User Provided valuenormValue
- The normalized valueLdapInvalidDnException
public AVA(String upType, String normType, Value<?> upValue, Value<?> normValue) throws LdapInvalidDnException
Note that the upValue should not be null or empty, or resolved to an empty string after having trimmed it.
upType
- The Usrr Provided typenormType
- The normalized typeupValue
- The User Provided valuenormValue
- The normalized valueLdapInvalidDnException
public AVA(String upType, String normType, Value<?> upValue, Value<?> normValue, String upName) throws LdapInvalidDnException
Note that the upValue should not be null or empty, or resolved to an empty string after having trimmed it.
upType
- The User Provided typenormType
- The normalized typeupValue
- The User Provided valuenormValue
- The normalized valueupName
- The User Provided name (may be escaped)LdapInvalidDnException
public String getNormType()
public String getUpType()
public void setType(String upType, String type) throws LdapInvalidDnException
upType
- The AVA User Provided typetype
- The AVA typeLdapInvalidDnException
- if the type or upType are empty or null.
If the upName is invalid.public void setTypeNormalized(String type) throws LdapInvalidDnException
type
- The AVA typeLdapInvalidDnException
public Value<?> getNormValue()
public Value<?> getUpValue()
public String getNormName()
public void setValue(Value<?> upValue, Value<?> normValue)
value
- The user provided value of the AVAnormValue
- The normalized valuepublic int getLength()
public int getStart()
public String getUpName()
public void setValueNormalized(String value)
value
- The value of the AVApublic Object clone()
public int compareTo(Object object)
compareTo
in interface Comparable
object
- public int compareToIgnoreCase(Object object)
object
- public String normalizeValue()
public String normalize()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(Object)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
An AVA is composed of a type and a value.
The data are stored following the structure :
- upName
The User provided ATAV
- start
The position of this ATAV in the DN
- length
The ATAV length
- upType
The user Provided Type
- normType
The normalized AttributeType
- isHR
- Tells if the value is a String or not
if the value is a String :
- upValue
The User Provided value.
- value
The normalized value.
if the value is binary :
- upValueLength
- upValue
The User Provided value.
- valueLength
- value
The normalized value.
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
We read back the data to create a new ATAV. The structure
read is exposed in the {@link AVA#writeExternal(ObjectOutput)}
method
Copyright © 2003–2013 The Apache Software Foundation. All rights reserved.