Class ImmutableHealthCheck.Builder
java.lang.Object
org.kiwiproject.consul.model.health.ImmutableHealthCheck.Builder
- Enclosing class:
- ImmutableHealthCheck
Builds instances of type
ImmutableHealthCheck
.
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 TypeMethodDescriptionaddAllServiceTags
(Iterable<String> elements) Adds elements toserviceTags
list.addServiceTags
(String element) Adds one element toserviceTags
list.addServiceTags
(String... elements) Adds elements toserviceTags
list.build()
Builds a newImmutableHealthCheck
.Initializes the value for thecheckId
attribute.from
(HealthCheck instance) Fill a builder with attribute values from the providedHealthCheck
instance.Initializes the value for thename
attribute.Initializes the value for thenode
attribute.Initializes the optional valuenotes
to notes.Initializes the optional valuenotes
to notes.Initializes the optional valueoutput
to output.Initializes the optional valueoutput
to output.Initializes the optional valueserviceId
to serviceId.Initializes the optional valueserviceId
to serviceId.serviceName
(String serviceName) Initializes the optional valueserviceName
to serviceName.serviceName
(Optional<String> serviceName) Initializes the optional valueserviceName
to serviceName.serviceTags
(Iterable<String> elements) Sets or replaces all elements forserviceTags
list.Initializes the value for thestatus
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedHealthCheck
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.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
node
Initializes the value for thenode
attribute.- Parameters:
node
- The value for node- Returns:
this
builder for use in a chained invocation
-
checkId
Initializes the value for thecheckId
attribute.- Parameters:
checkId
- The value for checkId- Returns:
this
builder for use in a chained invocation
-
name
Initializes the value for thename
attribute.- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
status
Initializes the value for thestatus
attribute.- Parameters:
status
- The value for status- Returns:
this
builder for use in a chained invocation
-
notes
Initializes the optional valuenotes
to notes.- Parameters:
notes
- The value for notes- Returns:
this
builder for chained invocation
-
notes
Initializes the optional valuenotes
to notes.- Parameters:
notes
- The value for notes- Returns:
this
builder for use in a chained invocation
-
output
Initializes the optional valueoutput
to output.- Parameters:
output
- The value for output- Returns:
this
builder for chained invocation
-
output
Initializes the optional valueoutput
to output.- Parameters:
output
- The value for output- Returns:
this
builder for use in a chained invocation
-
serviceId
Initializes the optional valueserviceId
to serviceId.- Parameters:
serviceId
- The value for serviceId- Returns:
this
builder for chained invocation
-
serviceId
@CanIgnoreReturnValue public final ImmutableHealthCheck.Builder serviceId(Optional<String> serviceId) Initializes the optional valueserviceId
to serviceId.- Parameters:
serviceId
- The value for serviceId- Returns:
this
builder for use in a chained invocation
-
serviceName
Initializes the optional valueserviceName
to serviceName.- Parameters:
serviceName
- The value for serviceName- Returns:
this
builder for chained invocation
-
serviceName
@CanIgnoreReturnValue public final ImmutableHealthCheck.Builder serviceName(Optional<String> serviceName) Initializes the optional valueserviceName
to serviceName.- Parameters:
serviceName
- The value for serviceName- Returns:
this
builder for use in a chained invocation
-
addServiceTags
Adds one element toserviceTags
list.- Parameters:
element
- A serviceTags element- Returns:
this
builder for use in a chained invocation
-
addServiceTags
Adds elements toserviceTags
list.- Parameters:
elements
- An array of serviceTags elements- Returns:
this
builder for use in a chained invocation
-
serviceTags
@CanIgnoreReturnValue public final ImmutableHealthCheck.Builder serviceTags(Iterable<String> elements) Sets or replaces all elements forserviceTags
list.- Parameters:
elements
- An iterable of serviceTags elements- Returns:
this
builder for use in a chained invocation
-
addAllServiceTags
@CanIgnoreReturnValue public final ImmutableHealthCheck.Builder addAllServiceTags(Iterable<String> elements) Adds elements toserviceTags
list.- Parameters:
elements
- An iterable of serviceTags elements- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableHealthCheck
.- Returns:
- An immutable instance of HealthCheck
- Throws:
IllegalStateException
- if any required attributes are missing
-