public class BinaryValue extends AbstractValue<byte[]>
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOG
logger for reporting errors that might not be handled properly upstream
|
protected static long |
serialVersionUID
Used for serialization
|
attributeType, normalized, normalizedValue, same, valid, wrappedValue| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
BinaryValue |
clone() |
int |
compareTo(Value<byte[]> value) |
void |
deserialize(ObjectInput in)
Deserialize a BinaryValue.
|
boolean |
equals(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.
|
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(ObjectInput in) |
void |
serialize(ObjectOutput out)
We will write the value and the normalized value, only
if the normalized value is different.
|
String |
toString()
Dumps binary in hex with label.
|
void |
writeExternal(ObjectOutput out) |
apply, getAttributeType, getLdapComparator, getMatchingRule, getNormalizer, getReference, instanceOf, isNormalized, isNull, isValid, isValid, setNormalizedprotected static final long serialVersionUID
protected static final org.slf4j.Logger LOG
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 arraypublic 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 valueLdapException - 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)
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 ObjectObject.hashCode()public boolean equals(Object obj)
equals in class ObjectIllegalStateException - on failures to extract the comparator, or the
normalizers needed to perform the required comparisons based on the schemapublic BinaryValue clone()
AbstractValueclone 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 String getString()
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionExternalizable.readExternal(ObjectInput)public void writeExternal(ObjectOutput out) throws IOException
IOExceptionExternalizable.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 valueIOExceptionClassNotFoundExceptionpublic String toString()
toString in class ObjectObject.toString()Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.