oracle.kv.table

## Interface FieldValue

- All Superinterfaces:
    Comparable<FieldValue>
  All Known Subinterfaces:
    ArrayValue, BinaryValue, BooleanValue, DoubleValue, EnumValue, FixedBinaryValue, FloatValue, IndexKey, IntegerValue, LongValue, MapValue, PrimaryKey, RecordValue, ReturnRow, Row, StringValue

      public interface FieldValue
      extends Comparable<FieldValue>

  FieldValue represents a value of a single field. A value may be simple or complex (single-valued vs multi-valued). FieldValue is the building block of row values in a table.

  The FieldValue interface defines casting and interrogation methods common to all implementing classes. Each implementing type has its own interface which is an extension of FieldValue. In most cases interfaces that extend FieldValue have corresponding classes that extend `FieldDef`. The exceptions are `Row`, `PrimaryKey` and `IndexKey`. These all extend `RecordValue` as they are specialized instances of records.

  By default fields can be nullable, which means that a special null value can be assigned to them. A null value is a FieldValue instance that returns true for `isNull()` and will throw exceptions for most other operations that require an actual instance of a type. This means that callers who might reasonably expect a null value should first check to see if the value is null before using the value.

  FieldValue instances are not thread safe.

  Since:
    3.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ArrayValue` | `asArray()` Casts to ArrayValue.
    `BinaryValue` | `asBinary()` Casts to BinaryValue.
    `BooleanValue` | `asBoolean()` Casts to BooleanValue.
    `DoubleValue` | `asDouble()` Casts to DoubleValue.
    `EnumValue` | `asEnum()` Casts to EnumValue.
    `FixedBinaryValue` | `asFixedBinary()` Casts to FixedBinaryValue.
    `FloatValue` | `asFloat()` Casts to FloatValue.
    `IndexKey` | `asIndexKey()` Casts to IndexKey.
    `IntegerValue` | `asInteger()` Casts to IntegerValue.
    `LongValue` | `asLong()` Casts to LongValue.
    `MapValue` | `asMap()` Casts to MapValue.
    `PrimaryKey` | `asPrimaryKey()` Casts to PrimaryKey.
    `RecordValue` | `asRecord()` Casts to RecordValue.
    `Row` | `asRow()` Casts to Row.
    `StringValue` | `asString()` Casts to StringValue.
    `FieldValue` | `clone()` Create a deep copy of this object.
    `FieldDef.Type` | `getType()` Get the type of the value.
    `boolean` | `isArray()` Returns true if this is an `ArrayValue`.
    `boolean` | `isBinary()` Returns true if this is a `BinaryValue`.
    `boolean` | `isBoolean()` Returns true if this is a `BooleanValue`.
    `boolean` | `isDouble()` Returns true if this is a `DoubleValue`.
    `boolean` | `isEnum()` Returns true if this is an `EnumValue`.
    `boolean` | `isFixedBinary()` Returns true if this is a `FixedBinaryValue`.
    `boolean` | `isFloat()` Returns true if this is a `FloatValue`.
    `boolean` | `isIndexKey()` Returns true if this is an `IndexKey`.
    `boolean` | `isInteger()` Returns true if this is an `IntegerValue`.
    `boolean` | `isLong()` Returns true if this is a `LongValue`.
    `boolean` | `isMap()` Returns true if this is a `MapValue`.
    `boolean` | `isNull()` Returns true if this is a null value instance.
    `boolean` | `isPrimaryKey()` Returns true if this is a `PrimaryKey`.
    `boolean` | `isRecord()` Returns true if this is a `RecordValue`.
    `boolean` | `isRow()` Returns true if this is a `Row`.
    `boolean` | `isString()` Returns true if this is a `StringValue`.
    `String` | `toJsonString(boolean prettyPrint)` Create a JSON representation of the value.

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Method Detail

    - #### getType

          FieldDef.Type getType()

      Get the type of the value.
      Returns:
        the type of the instance

    - #### toJsonString

          String toJsonString(boolean prettyPrint)

      Create a JSON representation of the value.
      Parameters:
        `prettyPrint` - set to true for a nicely formatted JSON string, with indentation and carriage returns, otherwise the string will be a single line
      Returns:
        a JSON representation of the value

    - #### isBoolean

          boolean isBoolean()

      Returns true if this is a `BooleanValue`.
      Returns:
        true if this is a BooleanValue, false otherwise

    - #### isBinary

          boolean isBinary()

      Returns true if this is a `BinaryValue`.
      Returns:
        true if this is a BinaryValue, false otherwise

    - #### isDouble

          boolean isDouble()

      Returns true if this is a `DoubleValue`.
      Returns:
        true if this is a DoubleValue, false otherwise

    - #### isEnum

          boolean isEnum()

      Returns true if this is an `EnumValue`.
      Returns:
        true if this is an EnumValue, false otherwise

    - #### isFixedBinary

          boolean isFixedBinary()

      Returns true if this is a `FixedBinaryValue`.
      Returns:
        true if this is a FixedBinaryValue, false otherwise

    - #### isFloat

          boolean isFloat()

      Returns true if this is a `FloatValue`.
      Returns:
        true if this is a FloatValue, false otherwise

    - #### isInteger

          boolean isInteger()

      Returns true if this is an `IntegerValue`.
      Returns:
        true if this is an IntegerValue, false otherwise

    - #### isLong

          boolean isLong()

      Returns true if this is a `LongValue`.
      Returns:
        true if this is a LongValue, false otherwise

    - #### isString

          boolean isString()

      Returns true if this is a `StringValue`.
      Returns:
        true if this is a StringValue, false otherwise

    - #### isArray

          boolean isArray()

      Returns true if this is an `ArrayValue`.
      Returns:
        true if this is an ArrayValue, false otherwise

    - #### isMap

          boolean isMap()

      Returns true if this is a `MapValue`.
      Returns:
        true if this is a MapValue, false otherwise

    - #### isRecord

          boolean isRecord()

      Returns true if this is a `RecordValue`.
      Returns:
        true if this is a RecordValue, false otherwise

    - #### isRow

          boolean isRow()

      Returns true if this is a `Row`. Row also returns true for `isRecord()`.
      Returns:
        true if this is a Row}, false otherwise

    - #### isPrimaryKey

          boolean isPrimaryKey()

      Returns true if this is a `PrimaryKey`. PrimaryKey also returns true for `isRecord()` and `isRow()`.
      Returns:
        true if this is a PrimaryKey}, false otherwise

    - #### isIndexKey

          boolean isIndexKey()

      Returns true if this is an `IndexKey`. IndexKey also returns true for `isRecord()`.
      Returns:
        true if this is an IndexKey}, false otherwise

    - #### isNull

          boolean isNull()

      Returns true if this is a null value instance.
      Returns:
        true if this is a null value, false otherwise.

    - #### clone

          FieldValue clone()

      Create a deep copy of this object.
      Returns:
        a new copy

    - #### asBinary

          BinaryValue asBinary()

      Casts to BinaryValue.
      Returns:
        a BinaryValue
      Throws:
        `ClassCastException` - if this is not a BinaryValue

    - #### asBoolean

          BooleanValue asBoolean()

      Casts to BooleanValue.
      Returns:
        a BooleanValue
      Throws:
        `ClassCastException` - if this is not a BooleanValue

    - #### asDouble

          DoubleValue asDouble()

      Casts to DoubleValue.
      Returns:
        a DoubleValue
      Throws:
        `ClassCastException` - if this is not a DoubleValue

    - #### asEnum

          EnumValue asEnum()

      Casts to EnumValue.
      Returns:
        an EnumValue
      Throws:
        `ClassCastException` - if this is not an EnumValue

    - #### asFixedBinary

          FixedBinaryValue asFixedBinary()

      Casts to FixedBinaryValue.
      Returns:
        a FixedBinaryValue
      Throws:
        `ClassCastException` - if this is not a FixedBinaryValue

    - #### asFloat

          FloatValue asFloat()

      Casts to FloatValue.
      Returns:
        a FloatValue
      Throws:
        `ClassCastException` - if this is not a FloatValue

    - #### asInteger

          IntegerValue asInteger()

      Casts to IntegerValue.
      Returns:
        an IntegerValue
      Throws:
        `ClassCastException` - if this is not an IntegerValue

    - #### asLong

          LongValue asLong()

      Casts to LongValue.
      Returns:
        a LongValue
      Throws:
        `ClassCastException` - if this is not a LongValue

    - #### asString

          StringValue asString()

      Casts to StringValue.
      Returns:
        a StringValue
      Throws:
        `ClassCastException` - if this is not a StringValue

    - #### asArray

          ArrayValue asArray()

      Casts to ArrayValue.
      Returns:
        an ArrayValue
      Throws:
        `ClassCastException` - if this is not an ArrayValue

    - #### asMap

          MapValue asMap()

      Casts to MapValue.
      Returns:
        a MapValue
      Throws:
        `ClassCastException` - if this is not a MapValue

    - #### asRecord

          RecordValue asRecord()

      Casts to RecordValue.
      Returns:
        a RecordValue
      Throws:
        `ClassCastException` - if this is not a RecordValue

    - #### asRow

          Row asRow()

      Casts to Row.
      Returns:
        a Row
      Throws:
        `ClassCastException` - if this is not a Row.

    - #### asPrimaryKey

          PrimaryKey asPrimaryKey()

      Casts to PrimaryKey.
      Returns:
        a PrimaryKey
      Throws:
        `ClassCastException` - if this is not a PrimaryKey

    - #### asIndexKey

          IndexKey asIndexKey()

      Casts to IndexKey.
      Returns:
        an IndexKey
      Throws:
        `ClassCastException` - if this is not an IndexKey

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