io.vertx.ext.consul

## Class TxnRequest

- java.lang.Object
- - io.vertx.ext.consul.TxnRequest

-     public class TxnRequest
      extends Object

  Holds list of operations in transaction
  Author:
    Ruslan Sennov

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TxnRequest()` Default constructor
    `TxnRequest(JsonObject json)` Constructor from JSON

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TxnRequest` | `addOperation(TxnOperation operation)` Adds operation to this request
    `List<TxnOperation>` | `getOperations()` Returns list of transaction operations
    `TxnOperation` | `getOperations(int index)` Returns the operation at the specified position in this list
    `int` | `getOperationsSize()` Returns the number of operations in this request
    `JsonObject` | `toJson()` Convert to JSON

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

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

- - ### Constructor Detail

    - #### TxnRequest

          public TxnRequest()

      Default constructor

    - #### TxnRequest

          public TxnRequest(JsonObject json)

      Constructor from JSON
      Parameters:
        `json` - the JSON

  - ### Method Detail

    - #### toJson

          public JsonObject toJson()

      Convert to JSON
      Returns:
        the JSON

    - #### getOperations

          public List<TxnOperation> getOperations()

      Returns list of transaction operations
      Returns:
        list of transaction operations

    - #### getOperationsSize

          public int getOperationsSize()

      Returns the number of operations in this request
      Returns:
        the number of operations in this request

    - #### getOperations

          public TxnOperation getOperations(int index)

      Returns the operation at the specified position in this list
      Parameters:
        `index` - index of the operation to return
      Returns:
        the operation at the specified position in this list

    - #### addOperation

          public TxnRequest addOperation(TxnOperation operation)

      Adds operation to this request
      Parameters:
        `operation` - operation to add
      Returns:
        reference to this, for fluency

Copyright © 2023 Eclipse. All rights reserved.