Package io.vertx.ext.consul
Class TxnKVOperation
- java.lang.Object
-
- io.vertx.ext.consul.TxnKVOperation
-
- All Implemented Interfaces:
TxnOperation
public class TxnKVOperation extends Object implements TxnOperation
Holds operation to apply to the key/value store inside a transaction- Author:
- Ruslan Sennov
-
-
Constructor Summary
Constructors Constructor Description TxnKVOperation()Default constructorTxnKVOperation(JsonObject json)Constructor from JSON
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetFlags()Get the flags attached to this entry.longgetIndex()Get the index used for locking, unlocking, and check-and-set operations.StringgetKey()Get the keyTxnOperationTypegetOperationType()Returns the type of operation in a transactionStringgetSession()Get the session used for locking, unlocking, and check-and-set operations.TxnKVVerbgetType()Get the type of operation to performStringgetValue()Get the valueTxnKVOperationsetFlags(long flags)Set the flags attached to this entry.TxnKVOperationsetIndex(long index)Set the index used for locking, unlocking, and check-and-set operations.TxnKVOperationsetKey(String key)Set the keyTxnKVOperationsetSession(String session)Set the session used for locking, unlocking, and check-and-set operations.TxnKVOperationsetType(TxnKVVerb type)Set the type of operation to performTxnKVOperationsetValue(String value)Set the valueJsonObjecttoJson()Convert to JSON
-
-
-
Constructor Detail
-
TxnKVOperation
public TxnKVOperation()
Default constructor
-
TxnKVOperation
public TxnKVOperation(JsonObject json)
Constructor from JSON- Parameters:
json- the JSON
-
-
Method Detail
-
toJson
public JsonObject toJson()
Convert to JSON- Returns:
- the JSON
-
getType
public TxnKVVerb getType()
Get the type of operation to perform- Returns:
- the type of operation to perform
-
getKey
public String getKey()
Get the key- Returns:
- the key
-
getValue
public String getValue()
Get the value- Returns:
- the value
-
getFlags
public long getFlags()
Get the flags attached to this entry. Clients can choose to use this however makes sense for their application.- Returns:
- the flags attached to this entry
-
getIndex
public long getIndex()
Get the index used for locking, unlocking, and check-and-set operations.- Returns:
- the index
- See Also:
- /v1/txn endpoint
-
getSession
public String getSession()
Get the session used for locking, unlocking, and check-and-set operations.- Returns:
- the session
- See Also:
- /v1/txn endpoint
-
setType
public TxnKVOperation setType(TxnKVVerb type)
Set the type of operation to perform- Parameters:
type- the type of operation to perform- Returns:
- reference to this, for fluency
-
setKey
public TxnKVOperation setKey(String key)
Set the key- Parameters:
key- the key- Returns:
- reference to this, for fluency
-
setValue
public TxnKVOperation setValue(String value)
Set the value- Parameters:
value- the value- Returns:
- reference to this, for fluency
-
setFlags
public TxnKVOperation setFlags(long flags)
Set the flags attached to this entry. Clients can choose to use this however makes sense for their application.- Parameters:
flags- the flags attached to this entry. Clients can choose to use this however makes sense for their application.- Returns:
- reference to this, for fluency
-
setIndex
public TxnKVOperation setIndex(long index)
Set the index used for locking, unlocking, and check-and-set operations.- Parameters:
index- the index- Returns:
- reference to this, for fluency
- See Also:
- /v1/txn endpoint
-
setSession
public TxnKVOperation setSession(String session)
Set the session used for locking, unlocking, and check-and-set operations.- Parameters:
session- the session- Returns:
- reference to this, for fluency
- See Also:
- /v1/txn endpoint
-
getOperationType
public TxnOperationType getOperationType()
Description copied from interface:TxnOperationReturns the type of operation in a transaction- Specified by:
getOperationTypein interfaceTxnOperation- Returns:
- the type of operation in a transaction
-
-