@NotThreadSafe public static final class ImmutableQueryResults.Builder extends Object
ImmutableQueryResults.
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 |
|---|---|
ImmutableQueryResults.Builder |
addAllNodes(Iterable<? extends ServiceHealth> elements)
Adds elements to
nodes list. |
ImmutableQueryResults.Builder |
addNodes(ServiceHealth... elements)
Adds elements to
nodes list. |
ImmutableQueryResults.Builder |
addNodes(ServiceHealth element)
Adds one element to
nodes list. |
ImmutableQueryResults |
build()
Builds a new
ImmutableQueryResults. |
ImmutableQueryResults.Builder |
from(QueryResults instance)
Fill a builder with attribute values from the provided
QueryResults instance. |
ImmutableQueryResults.Builder |
nodes(Iterable<? extends ServiceHealth> elements)
Sets or replaces all elements for
nodes list. |
ImmutableQueryResults.Builder |
service(String service)
Initializes the value for the
service attribute. |
@CanIgnoreReturnValue public final ImmutableQueryResults.Builder from(QueryResults instance)
QueryResults 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 ImmutableQueryResults.Builder service(String service)
service attribute.service - The value for servicethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResults.Builder addNodes(ServiceHealth element)
nodes list.element - A nodes elementthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResults.Builder addNodes(ServiceHealth... elements)
nodes list.elements - An array of nodes elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResults.Builder nodes(Iterable<? extends ServiceHealth> elements)
nodes list.elements - An iterable of nodes elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableQueryResults.Builder addAllNodes(Iterable<? extends ServiceHealth> elements)
nodes list.elements - An iterable of nodes elementsthis builder for use in a chained invocationpublic ImmutableQueryResults build()
ImmutableQueryResults.IllegalStateException - if any required attributes are missingCopyright © 2019. All rights reserved.