org.firebirdsql.gds.ng.fields

## Class FieldValue

- java.lang.Object
- - org.firebirdsql.gds.ng.fields.FieldValue

- All Implemented Interfaces:
    java.lang.Cloneable, FieldDataProvider

      public final class FieldValue
      extends java.lang.Object
      implements FieldDataProvider, java.lang.Cloneable

  Holder object for the value of a (statement) parameter or result set field.
  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FieldValue()` Creates an uninitialized FieldValue instance.
    `FieldValue(byte[] fieldData)` Creates an initialized FieldValue instance with the supplied `fieldData`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FieldValue` | `clone()` Clones this `FieldValue` instance.
    `java.lang.Object` | `getCachedObject()`
    `byte[]` | `getFieldData()` Get raw content of the filed.
    `boolean` | `isInitialized()` Is this field in an initialized state (meaning: was it explicitly set to a value (or null)).
    `void` | `reset()` Resets this field to an uninitialized state.
    `void` | `setCachedObject(java.lang.Object cachedObject)` Stores a cached object in this field.
    `void` | `setFieldData(byte[] fieldData)` Set raw content of the field.

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FieldValue

          public FieldValue()

      Creates an uninitialized FieldValue instance.

    - #### FieldValue

          public FieldValue(byte[] fieldData)

      Creates an initialized FieldValue instance with the supplied `fieldData`.
      Parameters:
        `fieldData` - Byte array with the value encoded as required by the type described in `fieldDescriptor`

  - ### Method Detail

    - #### getFieldData

          public byte[] getFieldData()

      Description copied from interface: `FieldDataProvider`
      Get raw content of the filed. This method returns the array of bytes sent by the server back.
      Specified by:
        `getFieldData` in interface `FieldDataProvider`
      Returns:
        contents of the field or `null` if NULL value was sent from the server.

    - #### setFieldData

          public void setFieldData(byte[] fieldData)

      Description copied from interface: `FieldDataProvider`
      Set raw content of the field.
      Specified by:
        `setFieldData` in interface `FieldDataProvider`
      Parameters:
        `fieldData` - raw content of the field.

    - #### getCachedObject

          public java.lang.Object getCachedObject()

      Returns:
        Cached object

    - #### setCachedObject

          public void setCachedObject(java.lang.Object cachedObject)

      Stores a cached object in this field.

      This is mostly used to store blob data for batched execution.

      Parameters:
        `cachedObject` - Object to cache

    - #### isInitialized

          public boolean isInitialized()

      Is this field in an initialized state (meaning: was it explicitly set to a value (or null)).
      Returns:
        `true` if initialized, `false` otherwise

    - #### reset

          public void reset()

      Resets this field to an uninitialized state.

    - #### clone

          public FieldValue clone()

      Clones this `FieldValue` instance.

      The contained field data is cloned as well, but the cached object is identical.

      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        Clone of this instance

Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.