Class TxnResponse

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

public class TxnResponse extends Object
Holds results of transaction
Author:
Ruslan Sennov
  • Constructor Details

    • TxnResponse

      public TxnResponse()
      Default constructor
    • TxnResponse

      public TxnResponse(JsonObject json)
      Constructor from JSON
      Parameters:
      json - the JSON
  • Method Details

    • 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