public class StringValue extends AbstractValue<String>
attributeType, h, LOG, normalizedValue, wrappedValue
Constructor and Description |
---|
StringValue(AttributeType attributeType)
Creates a StringValue without an initial wrapped value.
|
StringValue(AttributeType attributeType,
String value)
Creates a schema aware StringValue with an initial wrapped String value.
|
StringValue(String value)
Creates a StringValue with an initial wrapped String 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 wrapped value as a byte[].
|
String |
getNormValue()
Gets the normalized (canonical) representation for the wrapped string.
|
String |
getString()
Get the wrapped value as a String.
|
String |
getValue()
Get the wrapped 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, isValid
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(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 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 Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(Object)
public boolean isHumanReadable()
true
if the value is a String, false
otherwisepublic int length()
public byte[] getBytes()
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
IOException
ClassNotFoundException
public 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
IOException
public String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.