@NotThreadSafe public static final class ImmutableServiceHealth.Builder extends Object
ImmutableServiceHealth.
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 |
|---|---|
ImmutableServiceHealth.Builder |
addAllChecks(Iterable<? extends HealthCheck> elements)
Adds elements to
checks list. |
ImmutableServiceHealth.Builder |
addChecks(HealthCheck... elements)
Adds elements to
checks list. |
ImmutableServiceHealth.Builder |
addChecks(HealthCheck element)
Adds one element to
checks list. |
ImmutableServiceHealth |
build()
Builds a new
ImmutableServiceHealth. |
ImmutableServiceHealth.Builder |
checks(Iterable<? extends HealthCheck> elements)
Sets or replaces all elements for
checks list. |
ImmutableServiceHealth.Builder |
from(ServiceHealth instance)
Fill a builder with attribute values from the provided
ServiceHealth instance. |
ImmutableServiceHealth.Builder |
node(Node node)
Initializes the value for the
node attribute. |
ImmutableServiceHealth.Builder |
service(Service service)
Initializes the value for the
service attribute. |
public final ImmutableServiceHealth.Builder from(ServiceHealth instance)
ServiceHealth 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 invocationpublic final ImmutableServiceHealth.Builder node(Node node)
node attribute.node - The value for nodethis builder for use in a chained invocationpublic final ImmutableServiceHealth.Builder service(Service service)
service attribute.service - The value for servicethis builder for use in a chained invocationpublic final ImmutableServiceHealth.Builder addChecks(HealthCheck element)
checks list.element - A checks elementthis builder for use in a chained invocationpublic final ImmutableServiceHealth.Builder addChecks(HealthCheck... elements)
checks list.elements - An array of checks elementsthis builder for use in a chained invocationpublic final ImmutableServiceHealth.Builder checks(Iterable<? extends HealthCheck> elements)
checks list.elements - An iterable of checks elementsthis builder for use in a chained invocationpublic final ImmutableServiceHealth.Builder addAllChecks(Iterable<? extends HealthCheck> elements)
checks list.elements - An iterable of checks elementsthis builder for use in a chained invocationpublic ImmutableServiceHealth build()
ImmutableServiceHealth.IllegalStateException - if any required attributes are missingCopyright © 2018. All rights reserved.