@NotThreadSafe public static final class ImmutableFailover.Builder extends Object
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.
| Modifier and Type | Method and Description |
|---|---|
ImmutableFailover |
build()
Builds a new
ImmutableFailover. |
ImmutableFailover.Builder |
datacenters(List<String> datacenters)
Initializes the optional value
datacenters to datacenters. |
ImmutableFailover.Builder |
datacenters(Optional<? extends List<String>> datacenters)
Initializes the optional value
datacenters to datacenters. |
ImmutableFailover.Builder |
from(Failover instance)
Fill a builder with attribute values from the provided
Failover instance. |
ImmutableFailover.Builder |
nearestN(int nearestN)
Initializes the optional value
nearestN to nearestN. |
ImmutableFailover.Builder |
nearestN(Optional<Integer> nearestN)
Initializes the optional value
nearestN to nearestN. |
@CanIgnoreReturnValue public final ImmutableFailover.Builder from(Failover instance)
Failover instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFailover.Builder nearestN(int nearestN)
nearestN to nearestN.nearestN - The value for nearestNthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableFailover.Builder nearestN(Optional<Integer> nearestN)
nearestN to nearestN.nearestN - The value for nearestNthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFailover.Builder datacenters(List<String> datacenters)
datacenters to datacenters.datacenters - The value for datacentersthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableFailover.Builder datacenters(Optional<? extends List<String>> datacenters)
datacenters to datacenters.datacenters - The value for datacentersthis builder for use in a chained invocationpublic ImmutableFailover build()
ImmutableFailover.IllegalStateException - if any required attributes are missingCopyright © 2019. All rights reserved.