Class ImmutableFailover
java.lang.Object
org.kiwiproject.consul.model.query.Failover
org.kiwiproject.consul.model.query.ImmutableFailover
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableFailover
extends Failover
Immutable implementation of
Failover.
Use the builder to create immutable instances:
ImmutableFailover.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableFailover.Builderbuilder()Creates a builder forImmutableFailover.static ImmutableFailoverCreates an immutable copy of aFailovervalue.booleanThis instance is equal to all instances ofImmutableFailoverthat have equal attribute values.inthashCode()Computes a hash code from attributes:nearestN,datacenters.toString()Prints the immutable valueFailoverwith attribute values.final ImmutableFailoverwithDatacenters(List<String> value) Copy the current immutable object by setting a present value for the optionaldatacentersattribute.final ImmutableFailoverwithDatacenters(Optional<? extends List<String>> optional) Copy the current immutable object by setting an optional value for thedatacentersattribute.final ImmutableFailoverwithNearestN(int value) Copy the current immutable object by setting a present value for the optionalnearestNattribute.final ImmutableFailoverwithNearestN(Optional<Integer> optional) Copy the current immutable object by setting an optional value for thenearestNattribute.
-
Method Details
-
getNearestN
- Specified by:
getNearestNin classFailover- Returns:
- The value of the
nearestNattribute
-
datacenters
- Specified by:
datacentersin classFailover- Returns:
- The value of the
datacentersattribute
-
withNearestN
Copy the current immutable object by setting a present value for the optionalnearestNattribute.- Parameters:
value- The value for nearestN- Returns:
- A modified copy of
thisobject
-
withNearestN
Copy the current immutable object by setting an optional value for thenearestNattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for nearestN- Returns:
- A modified copy of
thisobject
-
withDatacenters
Copy the current immutable object by setting a present value for the optionaldatacentersattribute.- Parameters:
value- The value for datacenters- Returns:
- A modified copy of
thisobject
-
withDatacenters
Copy the current immutable object by setting an optional value for thedatacentersattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for datacenters- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableFailoverthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:nearestN,datacenters. -
toString
Prints the immutable valueFailoverwith attribute values. -
copyOf
Creates an immutable copy of aFailovervalue. 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 Failover instance
-
builder
Creates a builder forImmutableFailover.ImmutableFailover.builder() .nearestN(Integer) // optionalnearestN.datacenters(List<String>) // optionaldatacenters.build();- Returns:
- A new ImmutableFailover builder
-