|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.entry.AbstractValue<java.lang.String>
org.apache.directory.shared.ldap.entry.StringValue
public class StringValue
A server side schema aware wrapper around a String attribute value. This value wrapper uses schema information to syntax check values, and to compare them for equality and ordering. It caches results and invalidates them when the wrapped value changes.
Field Summary | |
---|---|
protected static org.slf4j.Logger |
LOG
logger for reporting errors that might not be handled properly upstream |
Fields inherited from class org.apache.directory.shared.ldap.entry.AbstractValue |
---|
attributeType, normalized, normalizedValue, same, valid, wrappedValue |
Constructor Summary | |
---|---|
StringValue()
Creates a StringValue without an initial wrapped value. |
|
StringValue(AttributeType attributeType)
Creates a StringValue without an initial wrapped value. |
|
StringValue(AttributeType attributeType,
java.lang.String value)
Creates a StringValue with an initial wrapped String value. |
|
StringValue(java.lang.String value)
Creates a StringValue with an initial wrapped String value. |
Method Summary | |
---|---|
StringValue |
clone()
Get a clone of the Client Value |
int |
compareTo(Value<java.lang.String> value)
|
void |
deserialize(java.io.ObjectInput in)
Deserialize a StringValue. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
get()
Get a copy of the stored value. |
byte[] |
getBytes()
Get the wrapped value as a byte[]. |
java.lang.String |
getNormalizedValue()
Gets the normalized (canonical) representation for the wrapped string. |
java.lang.String |
getNormalizedValueCopy()
Gets a copy of the the normalized (canonical) representation for the wrapped value. |
java.lang.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(java.io.ObjectInput in)
|
void |
serialize(java.io.ObjectOutput out)
We will write the value and the normalized value, only if the normalized value is different. |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.apache.directory.shared.ldap.entry.AbstractValue |
---|
apply, getAttributeType, getLdapComparator, getMatchingRule, getNormalizedValueReference, getNormalizer, getReference, instanceOf, isNormalized, isNull, isValid, isValid, setNormalized |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final org.slf4j.Logger LOG
Constructor Detail |
---|
public StringValue()
public StringValue(AttributeType attributeType)
attributeType
- the schema type associated with this StringValuepublic StringValue(java.lang.String value)
value
- the value to wrap which can be nullpublic StringValue(AttributeType attributeType, java.lang.String value)
attributeType
- the schema type associated with this StringValuewrapped
- the value to wrap which can be nullMethod Detail |
---|
public java.lang.String get()
public java.lang.String getNormalizedValue()
getNormalizedValue
in interface Value<java.lang.String>
getNormalizedValue
in class AbstractValue<java.lang.String>
public java.lang.String getNormalizedValueCopy()
public void normalize() throws LdapException
normalize
in interface Value<java.lang.String>
normalize
in class AbstractValue<java.lang.String>
LdapException
- if the value cannot be properly normalizedpublic final void normalize(Normalizer normalizer) throws LdapException
Normalizer
- The normalizer to apply to the value
LdapException
- If the value cannot be normalizedpublic 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(ServerValue)
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.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.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 java.lang.String getString()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
Externalizable.readExternal(ObjectInput)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
java.io.IOException
Externalizable.writeExternal(ObjectOutput)
public void serialize(java.io.ObjectOutput out) throws java.io.IOException
out
- the buffer in which we will stored the serialized form of the value
java.io.IOException
- if we can't write into the bufferpublic void deserialize(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- the buffer containing the bytes with the serialized value
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |