Package com.orbitz.consul.option
Class ImmutableTransactionOptions
- java.lang.Object
-
- com.orbitz.consul.option.TransactionOptions
-
- com.orbitz.consul.option.ImmutableTransactionOptions
-
- All Implemented Interfaces:
ParamAdder
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTransactionOptions extends TransactionOptionsImmutable implementation ofTransactionOptions.Use the builder to create immutable instances:
ImmutableTransactionOptions.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTransactionOptions.BuilderBuilds instances of typeImmutableTransactionOptions.
-
Field Summary
-
Fields inherited from class com.orbitz.consul.option.TransactionOptions
BLANK
-
-
Method Summary
Modifier and Type Method Description static ImmutableTransactionOptions.Builderbuilder()Creates a builder forImmutableTransactionOptions.static ImmutableTransactionOptionscopyOf(TransactionOptions instance)Creates an immutable copy of aTransactionOptionsvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableTransactionOptionsthat have equal attribute values.ConsistencyModegetConsistencyMode()java.util.Optional<java.lang.String>getDatacenter()inthashCode()Computes a hash code from attributes:datacenter,consistencyMode.java.lang.StringtoString()Prints the immutable valueTransactionOptionswith attribute values.ImmutableTransactionOptionswithConsistencyMode(ConsistencyMode value)Copy the current immutable object by setting a value for theconsistencyModeattribute.ImmutableTransactionOptionswithDatacenter(java.lang.String value)Copy the current immutable object by setting a present value for the optionaldatacenterattribute.ImmutableTransactionOptionswithDatacenter(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thedatacenterattribute.-
Methods inherited from class com.orbitz.consul.option.TransactionOptions
toHeaders, toQuery
-
-
-
-
Method Detail
-
getDatacenter
public java.util.Optional<java.lang.String> getDatacenter()
- Specified by:
getDatacenterin classTransactionOptions- Returns:
- The value of the
datacenterattribute
-
getConsistencyMode
public ConsistencyMode getConsistencyMode()
- Overrides:
getConsistencyModein classTransactionOptions- Returns:
- The value of the
consistencyModeattribute
-
withDatacenter
public final ImmutableTransactionOptions withDatacenter(java.lang.String value)
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
public final ImmutableTransactionOptions withDatacenter(java.util.Optional<java.lang.String> optional)
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
public final ImmutableTransactionOptions withConsistencyMode(ConsistencyMode value)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableTransactionOptionsthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:datacenter,consistencyMode.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueTransactionOptionswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTransactionOptions copyOf(TransactionOptions instance)
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
public static ImmutableTransactionOptions.Builder builder()
Creates a builder forImmutableTransactionOptions.ImmutableTransactionOptions.builder() .datacenter(String) // optionaldatacenter.consistencyMode(com.orbitz.consul.option.ConsistencyMode) // optionalconsistencyMode.build();- Returns:
- A new ImmutableTransactionOptions builder
-
-