public class Ava extends Object implements Externalizable, Cloneable, Comparable<Ava>
Constructor and Description |
---|
Ava()
Constructs an empty Ava
|
Ava(SchemaManager schemaManager)
Constructs an empty schema aware Ava.
|
Ava(SchemaManager schemaManager,
String upType,
byte[] upValue)
Construct a schema aware Ava containing a binary value.
|
Ava(SchemaManager schemaManager,
String upType,
String upValue)
Construct a schema aware Ava with a String value.
|
Ava(String upType,
byte[] upValue)
Construct an Ava containing a binary value.
|
Ava(String upType,
String upValue)
Construct an Ava with a String value.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(SchemaManager schemaManager)
Apply a SchemaManager to the Ava.
|
Ava |
clone()
Implements the cloning.
|
int |
compareTo(Ava that) |
int |
deserialize(byte[] buffer,
int pos)
Deserialize an AVA from a byte[], starting at a given position
|
boolean |
equals(Object obj) |
AttributeType |
getAttributeType() |
String |
getName()
Get the user provided form of this attribute type and value
|
String |
getNormName()
Get the normalized Name of a Ava
|
String |
getNormType()
Get the normalized type of a Ava
|
String |
getType()
Get the user provided type of a Ava
|
Value<?> |
getValue()
Get the Value of a Ava
|
int |
hashCode()
Gets the hashcode of this object.
|
boolean |
isSchemaAware()
Tells if the Ava is schema aware or not.
|
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.
|
void |
readExternal(ObjectInput in)
We read back the data to create a new ATAV.
|
int |
serialize(byte[] buffer,
int pos)
Serialize the AVA into a buffer at the given position.
|
String |
toString()
A String representation of an Ava, as provided by the user.
|
void |
writeExternal(ObjectOutput out)
An Ava is composed of a type and a value.
|
public Ava()
public Ava(SchemaManager schemaManager)
schemaManager
- The SchemaManager instancepublic Ava(String upType, byte[] upValue) throws LdapInvalidDnException
Note that the upValue should not be null or empty, or resolve to an empty string after having trimmed it.
upType
- The User Provided typeupValue
- The User Provided binary valueLdapInvalidDnException
- If the given type or value are invalidpublic Ava(SchemaManager schemaManager, String upType, byte[] upValue) throws LdapInvalidDnException
Note that the upValue should not be null or empty, or resolve to an empty string after having trimmed it.
schemaManager
- The SchemaManager instanceupType
- The User Provided typeupValue
- The User Provided binary valueLdapInvalidDnException
- If the given type or value are invalidpublic Ava(String upType, String upValue) throws LdapInvalidDnException
Note that the upValue should not be null or empty, or resolve to an empty string after having trimmed it.
upType
- The User Provided typeupValue
- The User Provided String valueLdapInvalidDnException
- If the given type or value are invalidpublic Ava(SchemaManager schemaManager, String upType, String upValue) throws LdapInvalidDnException
Note that the upValue should not be null or empty, or resolve to an empty string after having trimmed it.
schemaManager
- The SchemaManager instanceupType
- The User Provided typeupValue
- The User Provided String valueLdapInvalidDnException
- If the given type or value are invalidpublic void apply(SchemaManager schemaManager) throws LdapInvalidDnException
schemaManager
- The SchemaManager instance to useLdapInvalidDnException
- If the Ava can't be normalized accordingly
to the given SchemaManagerpublic String getNormType()
public String getNormName()
public String getName()
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 int serialize(byte[] buffer, int pos) throws IOException
buffer
- The buffer which will contain the serialized Avapos
- The position in the buffer for the serialized valueIOException
- If teh serialization failedpublic int deserialize(byte[] buffer, int pos) throws IOException, LdapInvalidAttributeValueException
buffer
- The buffer containing the AVApos
- The position in the bufferIOException
- If the serialized value is not an AVALdapInvalidAttributeValueException
- If the serialized AVA is invalidpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
- If the Ava can't be written in the streamExternalizable.readExternal(ObjectInput)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
writeExternal(ObjectOutput)
methodreadExternal
in interface Externalizable
IOException
- If the Ava can't b written to the streamClassNotFoundException
- If we can't deserialize an Ava from the streamExternalizable.readExternal(ObjectInput)
public boolean isSchemaAware()
public AttributeType getAttributeType()
public int compareTo(Ava that)
compareTo
in interface Comparable<Ava>
Comparable.compareTo(Object)
Copyright © 2003–2018 The Apache Software Foundation. All rights reserved.