public class StringValue extends AbstractValue<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,
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)
Compare the current value with a given 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, isValidprivate static final long serialVersionUID
private byte[] bytes
public 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 nullnormalizedValue - 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 wrapnormValue - The normalized form to storeLdapInvalidAttributeValueException - If the added value is invalid accordingly
to the schemapublic String getValue()
public String getNormValue()
public int compareTo(Value<String> value)
value - The Value to compare toIllegalStateException - on failures to extract the comparator, or the
normalizers needed to perform the required comparisons based on the schemapublic 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–2017 The Apache Software Foundation. All rights reserved.