Class ImmutableTransactionOptions

java.lang.Object
org.kiwiproject.consul.option.TransactionOptions
org.kiwiproject.consul.option.ImmutableTransactionOptions
All Implemented Interfaces:
ParamAdder

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableTransactionOptions extends TransactionOptions
Immutable implementation of TransactionOptions.

Use the builder to create immutable instances: ImmutableTransactionOptions.builder().

  • Method Details

    • toQueryParameters

      public com.google.common.collect.ImmutableList<String> toQueryParameters()
      Returns:
      The value of the toQueryParameters attribute
    • getDatacenter

      public Optional<String> getDatacenter()
      Specified by:
      getDatacenter in class TransactionOptions
      Returns:
      The value of the datacenter attribute
    • getConsistencyMode

      public ConsistencyMode getConsistencyMode()
      Overrides:
      getConsistencyMode in class TransactionOptions
      Returns:
      The value of the consistencyMode attribute
    • withToQueryParameters

      public final ImmutableTransactionOptions withToQueryParameters(String... elements)
      Copy the current immutable object with elements that replace the content of toQueryParameters.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withToQueryParameters

      public final ImmutableTransactionOptions withToQueryParameters(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of toQueryParameters. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of toQueryParameters elements to set
      Returns:
      A modified copy of this object
    • withDatacenter

      public final ImmutableTransactionOptions withDatacenter(String value)
      Copy the current immutable object by setting a present value for the optional datacenter attribute.
      Parameters:
      value - The value for datacenter
      Returns:
      A modified copy of this object
    • withDatacenter

      public final ImmutableTransactionOptions withDatacenter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the datacenter attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for datacenter
      Returns:
      A modified copy of this object
    • withConsistencyMode

      public final ImmutableTransactionOptions withConsistencyMode(ConsistencyMode value)
      Copy the current immutable object by setting a value for the consistencyMode attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for consistencyMode
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTransactionOptions that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: toQueryParameters, datacenter, consistencyMode.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value TransactionOptions with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableTransactionOptions copyOf(TransactionOptions instance)
      Creates an immutable copy of a TransactionOptions value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable TransactionOptions instance
    • builder

      public static ImmutableTransactionOptions.Builder builder()
      Creates a builder for ImmutableTransactionOptions.
       ImmutableTransactionOptions.builder()
          .addToQueryParameters|addAllToQueryParameters(String) // toQueryParameters elements
          .datacenter(String) // optional datacenter
          .consistencyMode(org.kiwiproject.consul.option.ConsistencyMode) // optional consistencyMode
          .build();
       
      Returns:
      A new ImmutableTransactionOptions builder