public class BinaryValue extends AbstractValue<byte[]>
Modifier and Type | Field and Description |
---|---|
static long |
serialVersionUID
Used for serialization
|
Constructor and Description |
---|
BinaryValue(AttributeType attributeType,
byte[] value)
Creates a BinaryValue with an initial user provided binary value.
|
BinaryValue(byte[] value)
Creates a BinaryValue with an initial user provided binary value.
|
Modifier and Type | Method and Description |
---|---|
BinaryValue |
clone()
Clone a Value
|
int |
compareTo(Value<byte[]> value)
Compare the current value with a provided one
|
static BinaryValue |
deserialize(AttributeType attributeType,
ObjectInput in)
Deserialize a schema aware BinaryValue.
|
static BinaryValue |
deserialize(ObjectInput in)
Deserialize a BinaryValue.
|
boolean |
equals(Object obj)
Checks to see if this BinaryValue equals the supplied object.
|
byte[] |
getBytes()
Get the user provided value as a byte[].
|
byte[] |
getNormValue()
Gets a direct reference to the normalized representation for the
user provided value of this ServerValue wrapper.
|
String |
getString()
Get the user provided value as a String.
|
byte[] |
getValue()
Get the User Provided value.
|
int |
hashCode() |
boolean |
isHumanReadable()
Tells if the current value is Human Readable
|
int |
length() |
void |
readExternal(ObjectInput in) |
String |
toString()
Dumps binary in hex with label.
|
void |
writeExternal(ObjectOutput out) |
apply, getAttributeType, getNormReference, getReference, isInstanceOf, isNull, isSchemaAware, isValid
public static final long serialVersionUID
public BinaryValue(byte[] value)
value
- the binary value to wrap which may be null, or a zero length byte arraypublic BinaryValue(AttributeType attributeType, byte[] value) throws LdapInvalidAttributeValueException
attributeType
- the schema type associated with this BinaryValuevalue
- the binary value to wrap which may be null, or a zero length byte arrayLdapInvalidAttributeValueException
- If the added value is invalid accordingly
to the schemapublic byte[] getNormValue()
public int compareTo(Value<byte[]> value)
value
- The value we want to compare topublic int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
public BinaryValue clone()
clone
in interface Value<byte[]>
clone
in class AbstractValue<byte[]>
public byte[] getValue()
public boolean isHumanReadable()
true
if the value is HR, false
otherwisepublic int length()
public byte[] getBytes()
getBytes
in interface Value<byte[]>
getBytes
in class AbstractValue<byte[]>
public String getString()
getString
in interface Value<byte[]>
getString
in class AbstractValue<byte[]>
public static BinaryValue deserialize(ObjectInput in) throws IOException, ClassNotFoundException
in
- The input streamIOException
- If the stream can't be readClassNotFoundException
- If we can't instanciate a BinaryValuepublic static BinaryValue 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 BinaryValuepublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
IOException
public String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2018 The Apache Software Foundation. All rights reserved.