Class ImmutableFailover.Builder
java.lang.Object
org.kiwiproject.consul.model.query.ImmutableFailover.Builder
- Enclosing class:
- ImmutableFailover
Builds instances of type
ImmutableFailover.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is 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 TypeMethodDescriptionbuild()Builds a newImmutableFailover.datacenters(List<String> datacenters) Initializes the optional valuedatacentersto datacenters.datacenters(Optional<? extends List<String>> datacenters) Initializes the optional valuedatacentersto datacenters.Fill a builder with attribute values from the providedFailoverinstance.nearestN(int nearestN) Initializes the optional valuenearestNto nearestN.Initializes the optional valuenearestNto nearestN.
-
Method Details
-
from
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
Initializes the optional valuenearestNto nearestN.- Parameters:
nearestN- The value for nearestN- Returns:
thisbuilder for chained invocation
-
nearestN
Initializes the optional valuenearestNto nearestN.- Parameters:
nearestN- The value for nearestN- Returns:
thisbuilder for use in a chained invocation
-
datacenters
Initializes the optional valuedatacentersto datacenters.- Parameters:
datacenters- The value for datacenters- Returns:
thisbuilder for chained invocation
-
datacenters
@CanIgnoreReturnValue public final ImmutableFailover.Builder datacenters(Optional<? extends List<String>> datacenters) Initializes the optional valuedatacentersto datacenters.- Parameters:
datacenters- The value for datacenters- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableFailover.- Returns:
- An immutable instance of Failover
- Throws:
IllegalStateException- if any required attributes are missing
-