|
||||||||||
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<byte[]>
org.apache.directory.shared.ldap.entry.BinaryValue
public class BinaryValue
A server side schema aware wrapper around a binary 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 |
protected static long |
serialVersionUID
Used for serialization |
Fields inherited from class org.apache.directory.shared.ldap.entry.AbstractValue |
---|
attributeType, normalized, normalizedValue, same, valid, wrappedValue |
Constructor Summary | |
---|---|
BinaryValue()
Creates a BinaryValue without an initial wrapped value. |
|
BinaryValue(AttributeType attributeType)
Creates a BinaryValue without an initial wrapped value. |
|
BinaryValue(AttributeType attributeType,
byte[] value)
Creates a BinaryValue with an initial wrapped binary value. |
|
BinaryValue(byte[] value)
Creates a BinaryValue with an initial wrapped binary value. |
Method Summary | |
---|---|
BinaryValue |
clone()
|
int |
compareTo(Value<byte[]> value)
|
void |
deserialize(java.io.ObjectInput in)
Deserialize a BinaryValue. |
boolean |
equals(java.lang.Object obj)
Checks to see if this BinaryValue equals the supplied object. |
byte[] |
get()
Get the wrapped value. |
byte[] |
getBytes()
Get the wrapped value as a byte[]. |
byte[] |
getNormalizedValue()
Gets the normalized (canonical) representation for the wrapped byte[]. |
byte[] |
getNormalizedValueCopy()
Gets a direct reference to the normalized representation for the wrapped value of this ServerValue wrapper. |
byte[] |
getNormalizedValueReference()
Gets the normalized (canonical) representation for the wrapped string. |
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()
Normalize the value. |
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()
Dumps binary in hex with label. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.apache.directory.shared.ldap.entry.AbstractValue |
---|
apply, getAttributeType, getLdapComparator, getMatchingRule, 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 long serialVersionUID
protected static final org.slf4j.Logger LOG
Constructor Detail |
---|
public BinaryValue()
attributeType
- the schema type associated with this BinaryValuepublic BinaryValue(AttributeType attributeType)
attributeType
- the schema type associated with this BinaryValuepublic BinaryValue(byte[] value)
attributeType
- the schema type associated with this BinaryValuevalue
- the binary value to wrap which may be null, or a zero length byte arraypublic BinaryValue(AttributeType attributeType, byte[] value)
attributeType
- the schema type associated with this BinaryValuevalue
- the binary value to wrap which may be null, or a zero length byte arrayMethod Detail |
---|
public byte[] getNormalizedValueCopy()
LdapException
- if schema entity resolution fails or normalization failspublic byte[] getNormalizedValueReference()
getNormalizedValueReference
in interface Value<byte[]>
getNormalizedValueReference
in class AbstractValue<byte[]>
public byte[] getNormalizedValue()
getNormalizedValue
in interface Value<byte[]>
getNormalizedValue
in class AbstractValue<byte[]>
public final void normalize(Normalizer normalizer) throws LdapException
Normalizer
- The normalizer to apply to the value
LdapException
- If the value cannot be normalizedpublic void normalize() throws LdapException
normalize
in interface Value<byte[]>
normalize
in class AbstractValue<byte[]>
LdapException
- If the value cannot be normalizedpublic int compareTo(Value<byte[]> 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 int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
java.lang.IllegalStateException
- on failures to extract the comparator, or the
normalizers needed to perform the required comparisons based on the schemapublic BinaryValue clone()
AbstractValue
clone
in interface Value<byte[]>
clone
in class AbstractValue<byte[]>
public byte[] get()
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 |