oracle.kv

## Class Value

- java.lang.Object
- - 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

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Value.Format` Identifies the format of a value.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Value` | `EMPTY_VALUE` An instance that represents an empty value for key-only records.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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`

- - ### Field Detail

    - #### EMPTY_VALUE

          public static final Value EMPTY_VALUE

      An instance that represents an empty value for key-only records.

  - ### 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`

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