io.vertx.ext.consul

## Class TxnResponse

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

-     public class TxnResponse
      extends Object

  Holds results of transaction
  Author:
    Ruslan Sennov

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TxnResponse` | `addError(TxnError error)` Adds error to this response
    `TxnResponse` | `addResult(TxnResult result)` Adds result to this response
    `TxnError` | `getError(int index)` Returns the errors at the specified position in this list
    `List<TxnError>` | `getErrors()` Returns list of transaction errors
    `int` | `getErrorsSize()` Returns the number of errors in this response
    `TxnResult` | `getResult(int index)` Returns the result at the specified position in this list
    `List<TxnResult>` | `getResults()` Returns list of transaction results
    `int` | `getResultsSize()` Returns the number of results in this response
    `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

    - #### TxnResponse

          public TxnResponse()

      Default constructor

    - #### TxnResponse

          public TxnResponse(JsonObject json)

      Constructor from JSON
      Parameters:
        `json` - the JSON

  - ### Method Detail

    - #### toJson

          public JsonObject toJson()

      Convert to JSON
      Returns:
        the JSON

    - #### getResults

          public List<TxnResult> getResults()

      Returns list of transaction results
      Returns:
        list of transaction results

    - #### getResultsSize

          public int getResultsSize()

      Returns the number of results in this response
      Returns:
        the number of results in this response

    - #### getResult

          public TxnResult getResult(int index)

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

    - #### addResult

          public TxnResponse addResult(TxnResult result)

      Adds result to this response
      Parameters:
        `result` - the result
      Returns:
        reference to this, for fluency

    - #### getErrors

          public List<TxnError> getErrors()

      Returns list of transaction errors
      Returns:
        list of transaction errors

    - #### getErrorsSize

          public int getErrorsSize()

      Returns the number of errors in this response
      Returns:
        the number of errors in this response

    - #### getError

          public TxnError getError(int index)

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

    - #### addError

          public TxnResponse addError(TxnError error)

      Adds error to this response
      Parameters:
        `error` - the error
      Returns:
        reference to this, for fluency

Copyright © 2019 Eclipse. All rights reserved.