Class PutOption.Builder

java.lang.Object
io.etcd.jetcd.options.PutOption.Builder
Enclosing class:
PutOption

public static final class PutOption.Builder extends Object
Builder to construct a put option.
  • Method Details

    • withLeaseId

      public PutOption.Builder withLeaseId(long leaseId)
      Assign a leaseId for a put operation. Zero means no lease.
      Parameters:
      leaseId - lease id to apply to a put operation
      Returns:
      builder
      Throws:
      IllegalArgumentException - if lease is less than zero.
    • withPrevKV

      public PutOption.Builder withPrevKV()
      When withPrevKV is set, put response contains previous key-value pair.
      Returns:
      builder
    • withAutoRetry

      public PutOption.Builder withAutoRetry()
      When autoRetry is set, treat this put as idempotent from the point of view of automated retries. Note under some failure scenarios autoRetry=true may make a put operation execute more than once, where a first attempt succeeded but its result did not reach the client; by default (autoRetry=false), the client won't retry since it is not safe to assume on such a failure that the operation did not happen in the server. Requesting withAutoRetry means the client is explicitly asking for retry nevertheless.
      Returns:
      builder
    • build

      public PutOption build()
      build the put option.
      Returns:
      the put option