Package oracle.nosql.driver.ops

## Class PutResult

- java.lang.Object
- - oracle.nosql.driver.ops.Result
  - - oracle.nosql.driver.ops.PutResult

-     public class PutResult
      extends Result

  Represents the result of a `NoSQLHandle.put(oracle.nosql.driver.ops.PutRequest)` operation.

  On a successful operation the value returned by `getVersion()` is non-null. On failure that value is null. Information about the existing row on failure may be available using `getExistingValue()` and.`getExistingVersion()`, depending on the use of `PutRequest.setReturnRow(boolean)` and whether the put had an option set using `PutRequest.setOption(oracle.nosql.driver.ops.PutRequest.Option)`.

  See Also:
    `NoSQLHandle.put(oracle.nosql.driver.ops.PutRequest)`

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PutResult()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `MapValue` | `getExistingValue()` | Returns the existing row value if available.
    `Version` | `getExistingVersion()` | Returns the existing row `Version` if available.
    `FieldValue` | `getGeneratedValue()` | Returns the value generated if the operation created a new value.
    `int` | `getReadKB()` | Returns the read throughput consumed by this operation, in KBytes.
    `int` | `getReadUnits()` | Returns the read throughput consumed by this operation, in read units.
    `Version` | `getVersion()` | Returns the `Version` of the new row if the operation was successful.
    `int` | `getWriteKB()` | Returns the write throughput consumed by this operation, in KBytes.
    `int` | `getWriteUnits()` | Returns the write throughput consumed by this operation, in write units.
    `String` | `toString()` |

    - ### Methods inherited from class oracle.nosql.driver.ops.Result

      `getRateLimitDelayedMs, getRetryStats`

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

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

- - ### Constructor Detail

    - #### PutResult

          public PutResult()

  - ### Method Detail

    - #### getVersion

          public Version getVersion()

      Returns the `Version` of the new row if the operation was successful. If the operation failed null is returned.
      Returns:
        the `Version` on success, null on failure

    - #### getExistingVersion

          public Version getExistingVersion()

      Returns the existing row `Version` if available. This value will only be available if the conditional put operation failed and the request specified that return information be returned using `PutRequest.setReturnRow(boolean)`.
      Returns:
        the Version

    - #### getExistingValue

          public MapValue getExistingValue()

      Returns the existing row value if available. This value will only be available if the conditional put operation failed and the request specified that return information be returned using `PutRequest.setReturnRow(boolean)`.
      Returns:
        the value

    - #### getReadKB

          public int getReadKB()

      Returns the read throughput consumed by this operation, in KBytes. This is the actual amount of data read by the operation. The number of read units consumed is returned by `getReadUnits()` which may be a larger number because this was an update operation.
      Returns:
        the read KBytes consumed

    - #### getWriteKB

          public int getWriteKB()

      Returns the write throughput consumed by this operation, in KBytes.
      Returns:
        the write KBytes consumed

    - #### getReadUnits

          public int getReadUnits()

      Returns the read throughput consumed by this operation, in read units. This number may be larger than that returned by `getReadKB()` because it was an update operation.
      Returns:
        the read units consumed

    - #### getWriteUnits

          public int getWriteUnits()

      Returns the write throughput consumed by this operation, in write units.
      Returns:
        the write units consumed

    - #### getGeneratedValue

          public FieldValue getGeneratedValue()

      Returns the value generated if the operation created a new value. This can happen if the table contains an identity column or string column declared as a generated UUID. If the table has no such columns this value is null. If a value was generated for the operation, it is non-null.
      Returns:
        the generated value
      Since:
        5.0.1

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`