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 classBuilds instances of typeImmutableServiceHealth. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableServiceHealth.static ImmutableServiceHealthcopyOf(ServiceHealth instance) Creates an immutable copy of aServiceHealthvalue.booleanThis instance is equal to all instances ofImmutableServiceHealththat have equal attribute values.com.google.common.collect.ImmutableList<HealthCheck>getNode()inthashCode()Computes a hash code from attributes:node,service,checks.toString()Prints the immutable valueServiceHealthwith attribute values.final ImmutableServiceHealthwithChecks(Iterable<? extends HealthCheck> elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableServiceHealthwithChecks(HealthCheck... elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableServiceHealthCopy the current immutable object by setting a value for thenodeattribute.final ImmutableServiceHealthwithService(Service value) Copy the current immutable object by setting a value for theserviceattribute.
-
Method Details
-
getNode
- Specified by:
getNodein classServiceHealth- Returns:
- The value of the
nodeattribute
-
getService
- Specified by:
getServicein classServiceHealth- Returns:
- The value of the
serviceattribute
-
getChecks
- Specified by:
getChecksin classServiceHealth- Returns:
- The value of the
checksattribute
-
withNode
Copy the current immutable object by setting a value for thenodeattribute. 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
thisobject
-
withService
Copy the current immutable object by setting a value for theserviceattribute. 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
thisobject
-
withChecks
Copy the current immutable object with elements that replace the content ofchecks.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
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
thisobject
-
equals
This instance is equal to all instances ofImmutableServiceHealththat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:node,service,checks. -
toString
Prints the immutable valueServiceHealthwith attribute values. -
copyOf
Creates an immutable copy of aServiceHealthvalue. 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) // requirednode.service(org.kiwiproject.consul.model.health.Service) // requiredservice.addChecks|addAllChecks(org.kiwiproject.consul.model.health.HealthCheck) //checkselements .build();- Returns:
- A new ImmutableServiceHealth builder
-