org.firebirdsql.gds.ng.fields

## Class RowValue

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

- All Implemented Interfaces:
    java.lang.Iterable<FieldValue>

      public final class RowValue
      extends java.lang.Object
      implements java.lang.Iterable<FieldValue>

  Collection of `FieldValue`. Usually a row or set of parameters.

  A `RowValue` itself is unmodifiable, but the `FieldValue` elements it contains are modifiable!

  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static RowValue` | `EMPTY_ROW_VALUE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RowValue(FieldValue[] fieldValues)` Creates a new `RowValues` object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `RowValue` | `deepCopy()` Copies this `RowValue` and the `FieldValue` elements it contains.
    `int` | `getCount()`
    `FieldValue` | `getFieldValue(int index)` Gets the `FieldValue` at the specified (0-based) index.
    `java.util.Iterator<FieldValue>` | `iterator()`
    `static RowValue` | `of(FieldValue... fieldValues)` Convenience method to construct a `RowValues` object with varargs parameters
    `static RowValue` | `of(RowDescriptor rowDescriptor, byte[]... rowData)` Convenience method for populating a row value from a RowDescriptor and byte arrays.

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

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

- - ### Field Detail

    - #### EMPTY_ROW_VALUE

          public static final RowValue EMPTY_ROW_VALUE

  - ### Constructor Detail

    - #### RowValue

          public RowValue(FieldValue[] fieldValues)

      Creates a new `RowValues` object.

      The array is copied, but the `FieldValue` elements in it are not

      The implementation assumes, but does not check that all elements are not null

      Parameters:
        `fieldValues` - Field value elements

  - ### Method Detail

    - #### getCount

          public int getCount()

      Returns:
        The number of fields.

    - #### getFieldValue

          public FieldValue getFieldValue(int index)

      Gets the `FieldValue` at the specified (0-based) index.
      Parameters:
        `index` - 0-based index of the field
      Returns:
        FieldValue
      Throws:
        `java.lang.IndexOutOfBoundsException` - if index is not `0 <= index < getCount`

    - #### iterator

          public java.util.Iterator<FieldValue> iterator()

      Specified by:
        `iterator` in interface `java.lang.Iterable<FieldValue>`

    - #### of

          public static RowValue of(FieldValue... fieldValues)

      Convenience method to construct a `RowValues` object with varargs parameters
      Parameters:
        `fieldValues` - Field value elements
      Returns:
        new `RowValues` object

    - #### of

          public static RowValue of(RowDescriptor rowDescriptor,
                    byte[]... rowData)

      Convenience method for populating a row value from a RowDescriptor and byte arrays.

      Note this method, and the similar `RowValueBuilder` are mainly intended for use in `FBDatabaseMetaData`.

      Parameters:
        `rowDescriptor` - The row descriptor
        `rowData` - An array of byte arrays with the field data.
      Returns:
        new `RowValues` object
      See Also:
        `RowValueBuilder`

    - #### deepCopy

          public RowValue deepCopy()

      Copies this `RowValue` and the `FieldValue` elements it contains.

      The `FieldValue` elements are copied by use of `FieldValue.clone()`.

      As `FieldValue` is mutable, it is important to consider whether you need to be able to see modifications to the field data, or if you need fields with the same original data. If the former, pass the original, if the latter use this method to obtain a copy.

      Returns:
        Copy of this object with cloned field values
      See Also:
        `For caveats`

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