Class ImmutableServiceHealth
java.lang.Object
org.kiwiproject.consul.model.health.ServiceHealth
org.kiwiproject.consul.model.health.ImmutableServiceHealth
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableServiceHealth
extends ServiceHealth
Immutable implementation of
ServiceHealth
.
Use the builder to create immutable instances:
ImmutableServiceHealth.builder()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableServiceHealth
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableServiceHealth
.static ImmutableServiceHealth
copyOf
(ServiceHealth instance) Creates an immutable copy of aServiceHealth
value.boolean
This instance is equal to all instances ofImmutableServiceHealth
that have equal attribute values.com.google.common.collect.ImmutableList<HealthCheck>
getNode()
int
hashCode()
Computes a hash code from attributes:node
,service
,checks
.toString()
Prints the immutable valueServiceHealth
with attribute values.final ImmutableServiceHealth
withChecks
(Iterable<? extends HealthCheck> elements) Copy the current immutable object with elements that replace the content ofchecks
.final ImmutableServiceHealth
withChecks
(HealthCheck... elements) Copy the current immutable object with elements that replace the content ofchecks
.final ImmutableServiceHealth
Copy the current immutable object by setting a value for thenode
attribute.final ImmutableServiceHealth
withService
(Service value) Copy the current immutable object by setting a value for theservice
attribute.
-
Method Details
-
getNode
- Specified by:
getNode
in classServiceHealth
- Returns:
- The value of the
node
attribute
-
getService
- Specified by:
getService
in classServiceHealth
- Returns:
- The value of the
service
attribute
-
getChecks
- Specified by:
getChecks
in classServiceHealth
- Returns:
- The value of the
checks
attribute
-
withNode
Copy the current immutable object by setting a value for thenode
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for node- Returns:
- A modified copy of the
this
object
-
withService
Copy the current immutable object by setting a value for theservice
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for service- Returns:
- A modified copy of the
this
object
-
withChecks
Copy the current immutable object with elements that replace the content ofchecks
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withChecks
Copy the current immutable object with elements that replace the content ofchecks
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of checks elements to set- Returns:
- A modified copy of
this
object
-
equals
This instance is equal to all instances ofImmutableServiceHealth
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:node
,service
,checks
. -
toString
Prints the immutable valueServiceHealth
with attribute values. -
copyOf
Creates an immutable copy of aServiceHealth
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable ServiceHealth instance
-
builder
Creates a builder forImmutableServiceHealth
.ImmutableServiceHealth.builder() .node(org.kiwiproject.consul.model.health.Node) // required
node
.service(org.kiwiproject.consul.model.health.Service) // requiredservice
.addChecks|addAllChecks(org.kiwiproject.consul.model.health.HealthCheck) //checks
elements .build();- Returns:
- A new ImmutableServiceHealth builder
-