public class StringValue extends AbstractValue<String>
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG
logger for reporting errors that might not be handled properly upstream
|
attributeType, normalized, normalizedValue, same, valid, wrappedValue
Constructor and Description |
---|
StringValue()
Creates a StringValue without an initial wrapped value.
|
StringValue(AttributeType attributeType)
Creates a StringValue without an initial wrapped value.
|
StringValue(AttributeType attributeType,
String value)
Creates a 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()
Get a clone of the Client Value
|
int |
compareTo(Value<String> value) |
void |
deserialize(ObjectInput in)
Deserialize a StringValue.
|
boolean |
equals(Object obj) |
String |
get()
Get a copy of the stored value.
|
byte[] |
getBytes()
Get the wrapped value as a byte[].
|
String |
getNormalizedValue()
Gets the normalized (canonical) representation for the wrapped string.
|
String |
getNormalizedValueCopy()
Gets a copy of the the normalized (canonical) representation
for the wrapped value.
|
String |
getString()
Get the wrapped value as a String.
|
int |
hashCode() |
boolean |
isBinary()
Tells if the current value is Binary or String
|
int |
length() |
void |
normalize()
Compute the normalized (canonical) representation for the wrapped string.
|
void |
normalize(Normalizer normalizer)
Normalize the value.
|
void |
readExternal(ObjectInput in) |
void |
serialize(ObjectOutput out)
We will write the value and the normalized value, only
if the normalized value is different.
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
apply, getAttributeType, getLdapComparator, getMatchingRule, getNormalizedValueReference, getNormalizer, getReference, instanceOf, isNormalized, isNull, isValid, isValid, setNormalized
protected static final org.slf4j.Logger LOG
public StringValue()
public StringValue(AttributeType attributeType)
attributeType
- the schema type associated with this StringValuepublic StringValue(String value)
value
- the value to wrap which can be nullpublic StringValue(AttributeType attributeType, String value)
attributeType
- the schema type associated with this StringValuewrapped
- the value to wrap which can be nullpublic String get()
public String getNormalizedValue()
getNormalizedValue
in interface Value<String>
getNormalizedValue
in class AbstractValue<String>
public String getNormalizedValueCopy()
public void normalize() throws LdapException
normalize
in interface Value<String>
normalize
in class AbstractValue<String>
LdapException
- if the value cannot be properly normalizedpublic final void normalize(Normalizer normalizer) throws LdapException
Normalizer
- The normalizer to apply to the valueLdapException
- If the value cannot be normalizedpublic 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(ServerValue)
public StringValue clone()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Two StringValue are equals if their normalized values are equal
public boolean isBinary()
true
if the value is Binary, false
otherwisepublic int length()
public byte[] getBytes()
public String getString()
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
Externalizable.readExternal(ObjectInput)
public void writeExternal(ObjectOutput out) throws IOException
IOException
Externalizable.writeExternal(ObjectOutput)
public void serialize(ObjectOutput out) throws IOException
out
- the buffer in which we will stored the serialized form of the valueIOException
- if we can't write into the bufferpublic void deserialize(ObjectInput in) throws IOException, ClassNotFoundException
in
- the buffer containing the bytes with the serialized valueIOException
ClassNotFoundException
public String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.