Package org.kiwiproject.consul.option
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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableTransactionOptions. -
Field Summary
Fields inherited from class org.kiwiproject.consul.option.TransactionOptions
BLANK -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableTransactionOptions.static ImmutableTransactionOptionscopyOf(TransactionOptions instance) Creates an immutable copy of aTransactionOptionsvalue.booleanThis instance is equal to all instances ofImmutableTransactionOptionsthat have equal attribute values.inthashCode()Computes a hash code from attributes:toQueryParameters,datacenter,consistencyMode.com.google.common.collect.ImmutableList<String>toString()Prints the immutable valueTransactionOptionswith attribute values.Copy the current immutable object by setting a value for theconsistencyModeattribute.withDatacenter(String value) Copy the current immutable object by setting a present value for the optionaldatacenterattribute.withDatacenter(Optional<String> optional) Copy the current immutable object by setting an optional value for thedatacenterattribute.withToQueryParameters(Iterable<String> elements) Copy the current immutable object with elements that replace the content oftoQueryParameters.withToQueryParameters(String... elements) Copy the current immutable object with elements that replace the content oftoQueryParameters.Methods inherited from class org.kiwiproject.consul.option.TransactionOptions
toHeaders, toQuery
-
Method Details
-
toQueryParameters
- Returns:
- The value of the
toQueryParametersattribute
-
getDatacenter
- Specified by:
getDatacenterin classTransactionOptions- Returns:
- The value of the
datacenterattribute
-
getConsistencyMode
- Overrides:
getConsistencyModein classTransactionOptions- Returns:
- The value of the
consistencyModeattribute
-
withToQueryParameters
Copy the current immutable object with elements that replace the content oftoQueryParameters.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withToQueryParameters
Copy the current immutable object with elements that replace the content oftoQueryParameters. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of toQueryParameters elements to set- Returns:
- A modified copy of
thisobject
-
withDatacenter
Copy the current immutable object by setting a present value for the optionaldatacenterattribute.- Parameters:
value- The value for datacenter- Returns:
- A modified copy of
thisobject
-
withDatacenter
Copy the current immutable object by setting an optional value for thedatacenterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for datacenter- Returns:
- A modified copy of
thisobject
-
withConsistencyMode
Copy the current immutable object by setting a value for theconsistencyModeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for consistencyMode- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableTransactionOptionsthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:toQueryParameters,datacenter,consistencyMode. -
toString
Prints the immutable valueTransactionOptionswith attribute values. -
copyOf
Creates an immutable copy of aTransactionOptionsvalue. 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
Creates a builder forImmutableTransactionOptions.ImmutableTransactionOptions.builder() .addToQueryParameters|addAllToQueryParameters(String) //toQueryParameterselements .datacenter(String) // optionaldatacenter.consistencyMode(org.kiwiproject.consul.option.ConsistencyMode) // optionalconsistencyMode.build();- Returns:
- A new ImmutableTransactionOptions builder
-