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 Details

    • TxnKVOperation

      public TxnKVOperation()
      Default constructor
    • TxnKVOperation

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

    • 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:
    • getSession

      public String getSession()
      Get the session used for locking, unlocking, and check-and-set operations.
      Returns:
      the session
      See Also:
    • 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:
    • 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:
    • getOperationType

      public TxnOperationType getOperationType()
      Description copied from interface: TxnOperation
      Returns the type of operation in a transaction
      Specified by:
      getOperationType in interface TxnOperation
      Returns:
      the type of operation in a transaction