Oracle NoSQL Database
version 11gR2.2.0.26

oracle.kv
Class Value

java.lang.Object
  extended by oracle.kv.Value
All Implemented Interfaces:
oracle.kv.impl.util.FastExternalizable

public class Value
extends Object
implements oracle.kv.impl.util.FastExternalizable

The Value in a Key/Value store.


Nested Class Summary
static class Value.Format
          Identifies the format of a value.
 
Method Summary
static Value createValue(byte[] val)
          Creates a Value from a value byte array.
 boolean equals(Object other)
           
static Value fromByteArray(byte[] bytes)
          Deserializes the given bytes that were returned earlier by toByteArray() and returns the resulting Value.
 Value.Format getFormat()
          Returns the value's format.
 byte[] getValue()
          Returns the value byte array.
 int hashCode()
           
 byte[] toByteArray()
          Returns this Value as a serialized byte array, such that fromByteArray(byte[]) may be used to reconstitute the Value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.kv.impl.util.FastExternalizable
writeFastExternal
 

Method Detail

toByteArray

public byte[] toByteArray()
Returns this Value as a serialized byte array, such that fromByteArray(byte[]) may be used to reconstitute the Value.

Note that this method does not always return an array equal to the getValue() array. The serialized representation of a Value may contain an extra byte identifying the format.


fromByteArray

public static Value fromByteArray(byte[] bytes)
Deserializes the given bytes that were returned earlier by toByteArray() and returns the resulting Value.

Note that an array equal to the getValue() array may not be passed to this method. To create a Value from only the value array, call createValue(byte[]) instead.


createValue

public static Value createValue(byte[] val)
Creates a Value from a value byte array. The format of the returned value is Value.Format.NONE. This method may not be used to create Avro values; for that, use an AvroBinding instead.


getValue

public byte[] getValue()
Returns the value byte array.


getFormat

public Value.Format getFormat()
Returns the value's format.

Since:
2.0

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Oracle NoSQL Database
version 11gR2.2.0.26

Copyright (c) 2011, 2013 Oracle and/or its affiliates. All rights reserved.