Package 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 Description TxnResponse()
Default constructorTxnResponse(JsonObject json)
Constructor from JSON
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TxnResponse
addError(TxnError error)
Adds error to this responseTxnResponse
addResult(TxnResult result)
Adds result to this responseTxnError
getError(int index)
Returns the errors at the specified position in this listList<TxnError>
getErrors()
Returns list of transaction errorsint
getErrorsSize()
Returns the number of errors in this responseTxnResult
getResult(int index)
Returns the result at the specified position in this listList<TxnResult>
getResults()
Returns list of transaction resultsint
getResultsSize()
Returns the number of results in this responseJsonObject
toJson()
Convert to JSON
-
-
-
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
-
-