public class StringValue extends AbstractValue<java.lang.String>
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
bytes
The UTF-8 bytes for this value
|
private static long |
serialVersionUID
Used for serialization
|
attributeType, h, LOG, normalizedValue, upValue| Constructor and Description |
|---|
StringValue(AttributeType attributeType)
Creates a StringValue without an initial user provided value.
|
StringValue(AttributeType attributeType,
java.lang.String value)
Creates a schema aware StringValue with an initial user provided String value.
|
StringValue(AttributeType attributeType,
java.lang.String value,
java.lang.String normValue)
Creates a schema aware StringValue with an initial user provided String value.
|
StringValue(java.lang.String value)
Creates a StringValue with an initial user provided String value.
|
StringValue(java.lang.String value,
java.lang.String normalizedValue)
Creates a StringValue with an initial user provided String value and a normalized value.
|
| Modifier and Type | Method and Description |
|---|---|
StringValue |
clone()
Clone a Value
|
int |
compareTo(Value<java.lang.String> value) |
static StringValue |
deserialize(AttributeType attributeType,
java.io.ObjectInput in)
Deserialize a schemaAware StringValue.
|
int |
deserialize(byte[] buffer,
int pos)
Deserialize a StringValue from a byte[], starting at a given position
|
static StringValue |
deserialize(java.io.ObjectInput in)
Deserialize a StringValue.
|
boolean |
equals(java.lang.Object obj)
Two StringValue are equals if their normalized values are equal
|
byte[] |
getBytes()
Get the user provided value as a byte[].
|
java.lang.String |
getNormValue()
Gets the normalized (canonical) representation for the wrapped string.
|
java.lang.String |
getString()
Get the user provided value as a String.
|
java.lang.String |
getValue()
Get the User Provided value.
|
int |
hashCode() |
boolean |
isHumanReadable()
Tells if the current value is Human Readable
|
int |
length() |
void |
readExternal(java.io.ObjectInput in) |
int |
serialize(byte[] buffer,
int pos)
Serialize the StringValue into a buffer at the given position.
|
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
apply, getAttributeType, getLdapComparator, getNormReference, getReference, isInstanceOf, isNull, isSchemaAware, isValidprivate static final long serialVersionUID
private byte[] bytes
public StringValue(AttributeType attributeType)
attributeType - the schema attribute type associated with this StringValuepublic StringValue(java.lang.String value)
value - the value to wrap which can be nullpublic StringValue(java.lang.String value,
java.lang.String normalizedValue)
value - the user provided value to wrap which can be nullnormValue - the normalized value to wrap which can be nullpublic StringValue(AttributeType attributeType, java.lang.String value) throws LdapInvalidAttributeValueException
attributeType - the schema type associated with this StringValuevalue - the value to wrapLdapInvalidAttributeValueException - If the added value is invalid accordingly
to the schemapublic StringValue(AttributeType attributeType, java.lang.String value, java.lang.String normValue) throws LdapInvalidAttributeValueException
attributeType - the schema type associated with this StringValuevalue - the value to wrapLdapInvalidAttributeValueException - If the added value is invalid accordingly
to the schemapublic java.lang.String getValue()
public java.lang.String getNormValue()
public int compareTo(Value<java.lang.String> value)
java.lang.IllegalStateException - on failures to extract the comparator, or the
normalizers needed to perform the required comparisons based on the schemaServerValue#compareTo(Value)public StringValue clone()
clone in interface Value<java.lang.String>clone in class AbstractValue<java.lang.String>public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(Object)public boolean isHumanReadable()
true if the value is a String, false otherwisepublic int length()
public byte[] getBytes()
getBytes in interface Value<java.lang.String>getBytes in class AbstractValue<java.lang.String>public java.lang.String getString()
getString in interface Value<java.lang.String>getString in class AbstractValue<java.lang.String>public static StringValue deserialize(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
in - The input streamjava.io.IOException - If the stream can't be readjava.lang.ClassNotFoundException - If we can't instanciate a StringValuepublic static StringValue deserialize(AttributeType attributeType, java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
attributeType - The AttributeType associated with the Value. Can be nullin - The input streamjava.io.IOException - If the stream can't be readjava.lang.ClassNotFoundException - If we can't instanciate a StringValuepublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic int serialize(byte[] buffer,
int pos)
buffer - The buffer which will contain the serialized StringValuepos - The position in the buffer for the serialized valuepublic int deserialize(byte[] buffer,
int pos)
throws java.io.IOException
buffer - The buffer containing the StringValuepos - The position in the bufferjava.io.IOException - If the serialized value is not a StringValuepublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()