public class StringValue extends AbstractValue<String>
attributeType, h, LOG, normalizedValue, upValue| Constructor and Description |
|---|
StringValue(AttributeType attributeType)
Creates a StringValue without an initial user provided value.
|
StringValue(AttributeType attributeType,
String value)
Creates a schema aware StringValue with an initial user provided String value.
|
StringValue(AttributeType attributeType,
String value,
String normValue)
Creates a schema aware StringValue with an initial user provided String value.
|
StringValue(String value)
Creates a StringValue with an initial user provided String value.
|
StringValue(String value,
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<String> value) |
static StringValue |
deserialize(AttributeType attributeType,
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(ObjectInput in)
Deserialize a StringValue.
|
boolean |
equals(Object obj)
Two StringValue are equals if their normalized values are equal
|
byte[] |
getBytes()
Get the user provided value as a byte[].
|
String |
getNormValue()
Gets the normalized (canonical) representation for the wrapped string.
|
String |
getString()
Get the user provided value as a String.
|
String |
getValue()
Get the User Provided value.
|
int |
hashCode() |
boolean |
isHumanReadable()
Tells if the current value is Human Readable
|
int |
length() |
void |
readExternal(ObjectInput in) |
int |
serialize(byte[] buffer,
int pos)
Serialize the StringValue into a buffer at the given position.
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
apply, getAttributeType, getLdapComparator, getNormReference, getReference, isInstanceOf, isNull, isSchemaAware, isValidpublic StringValue(AttributeType attributeType)
attributeType - the schema attribute type associated with this StringValuepublic StringValue(String value)
value - the value to wrap which can be nullpublic StringValue(String value, 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, 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, String value, 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 String getValue()
public String getNormValue()
public int compareTo(Value<String> value)
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()
public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean equals(Object obj)
equals in class ObjectObject.equals(Object)public boolean isHumanReadable()
true if the value is a String, false otherwisepublic int length()
public byte[] getBytes()
public String getString()
public static StringValue deserialize(ObjectInput in) throws IOException, ClassNotFoundException
in - The input streamIOException - If the stream can't be readClassNotFoundException - If we can't instanciate a StringValuepublic static StringValue deserialize(AttributeType attributeType, ObjectInput in) throws IOException, ClassNotFoundException
attributeType - The AttributeType associated with the Value. Can be nullin - The input streamIOException - If the stream can't be readClassNotFoundException - If we can't instanciate a StringValuepublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic 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 IOException
buffer - The buffer containing the StringValuepos - The position in the bufferIOException - If the serialized value is not a StringValuepublic void writeExternal(ObjectOutput out) throws IOException
IOExceptionpublic String toString()
toString in class ObjectObject.toString()Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.