@NotThreadSafe public static final class ImmutableQueryResult.Builder extends Object
ImmutableQueryResult.
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 |
|---|---|
ImmutableQueryResult.Builder |
addAllChecks(Iterable<? extends HealthCheck> elements)
Adds elements to
checks list. |
ImmutableQueryResult.Builder |
addChecks(HealthCheck... elements)
Adds elements to
checks list. |
ImmutableQueryResult.Builder |
addChecks(HealthCheck element)
Adds one element to
checks list. |
ImmutableQueryResult |
build()
Builds a new
ImmutableQueryResult. |
ImmutableQueryResult.Builder |
checks(Iterable<? extends HealthCheck> elements)
Sets or replaces all elements for
checks list. |
ImmutableQueryResult.Builder |
datacenters(Optional<String> datacenters)
Initializes the optional value
datacenters to datacenters. |
ImmutableQueryResult.Builder |
datacenters(String datacenters)
Initializes the optional value
datacenters to datacenters. |
ImmutableQueryResult.Builder |
dns(DnsQuery dns)
Initializes the optional value
dns to dns. |
ImmutableQueryResult.Builder |
dns(Optional<? extends DnsQuery> dns)
Initializes the optional value
dns to dns. |
ImmutableQueryResult.Builder |
failovers(int failovers)
Initializes the optional value
failovers to failovers. |
ImmutableQueryResult.Builder |
failovers(Optional<Integer> failovers)
Initializes the optional value
failovers to failovers. |
ImmutableQueryResult.Builder |
from(QueryResult instance)
Fill a builder with attribute values from the provided
QueryResult instance. |
ImmutableQueryResult.Builder |
node(Node node)
Initializes the value for the
node attribute. |
ImmutableQueryResult.Builder |
service(Service service)
Initializes the value for the
service attribute. |
@CanIgnoreReturnValue public final ImmutableQueryResult.Builder from(QueryResult instance)
QueryResult instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.
Collection elements and entries will be added, not replaced.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder node(Node node)
node attribute.node - The value for nodethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder service(Service service)
service attribute.service - The value for servicethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder addChecks(HealthCheck element)
checks list.element - A checks elementthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder addChecks(HealthCheck... elements)
checks list.elements - An array of checks elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder checks(Iterable<? extends HealthCheck> elements)
checks list.elements - An iterable of checks elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder addAllChecks(Iterable<? extends HealthCheck> elements)
checks list.elements - An iterable of checks elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder dns(DnsQuery dns)
dns to dns.dns - The value for dnsthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder dns(Optional<? extends DnsQuery> dns)
dns to dns.dns - The value for dnsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder datacenters(String datacenters)
datacenters to datacenters.datacenters - The value for datacentersthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder datacenters(Optional<String> datacenters)
datacenters to datacenters.datacenters - The value for datacentersthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder failovers(int failovers)
failovers to failovers.failovers - The value for failoversthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableQueryResult.Builder failovers(Optional<Integer> failovers)
failovers to failovers.failovers - The value for failoversthis builder for use in a chained invocationpublic ImmutableQueryResult build()
ImmutableQueryResult.IllegalStateException - if any required attributes are missingCopyright © 2019. All rights reserved.