Package com.orbitz.consul.model.query
Class ImmutableFailover.Builder
- java.lang.Object
-
- com.orbitz.consul.model.query.ImmutableFailover.Builder
-
- Enclosing class:
- ImmutableFailover
@NotThreadSafe public static final class ImmutableFailover.Builder extends java.lang.ObjectBuilds instances of typeImmutableFailover. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
Modifier and Type Method Description ImmutableFailoverbuild()Builds a newImmutableFailover.ImmutableFailover.Builderdatacenters(java.util.List<java.lang.String> datacenters)Initializes the optional valuedatacentersto datacenters.ImmutableFailover.Builderdatacenters(java.util.Optional<? extends java.util.List<java.lang.String>> datacenters)Initializes the optional valuedatacentersto datacenters.ImmutableFailover.Builderfrom(Failover instance)Fill a builder with attribute values from the providedFailoverinstance.ImmutableFailover.BuildernearestN(int nearestN)Initializes the optional valuenearestNto nearestN.ImmutableFailover.BuildernearestN(java.util.Optional<java.lang.Integer> nearestN)Initializes the optional valuenearestNto nearestN.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableFailover.Builder from(Failover instance)
Fill a builder with attribute values from the providedFailoverinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
nearestN
@CanIgnoreReturnValue public final ImmutableFailover.Builder nearestN(int nearestN)
Initializes the optional valuenearestNto nearestN.- Parameters:
nearestN- The value for nearestN- Returns:
thisbuilder for chained invocation
-
nearestN
@CanIgnoreReturnValue public final ImmutableFailover.Builder nearestN(java.util.Optional<java.lang.Integer> nearestN)
Initializes the optional valuenearestNto nearestN.- Parameters:
nearestN- The value for nearestN- Returns:
thisbuilder for use in a chained invocation
-
datacenters
@CanIgnoreReturnValue public final ImmutableFailover.Builder datacenters(java.util.List<java.lang.String> datacenters)
Initializes the optional valuedatacentersto datacenters.- Parameters:
datacenters- The value for datacenters- Returns:
thisbuilder for chained invocation
-
datacenters
@CanIgnoreReturnValue public final ImmutableFailover.Builder datacenters(java.util.Optional<? extends java.util.List<java.lang.String>> datacenters)
Initializes the optional valuedatacentersto datacenters.- Parameters:
datacenters- The value for datacenters- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableFailover build()
Builds a newImmutableFailover.- Returns:
- An immutable instance of Failover
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-