Class ImmutableServiceCheck
java.lang.Object
org.kiwiproject.consul.model.health.ServiceCheck
org.kiwiproject.consul.model.health.ImmutableServiceCheck
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableServiceCheck
extends ServiceCheck
Immutable implementation of
ServiceCheck.
Use the builder to create immutable instances:
ImmutableServiceCheck.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableServiceCheck. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableServiceCheck.static ImmutableServiceCheckcopyOf(ServiceCheck instance) Creates an immutable copy of aServiceCheckvalue.booleanThis instance is equal to all instances ofImmutableServiceCheckthat 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 valueServiceCheckwith attribute values.final ImmutableServiceCheckwithChecks(Iterable<? extends HealthCheck> elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableServiceCheckwithChecks(HealthCheck... elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableServiceCheckCopy the current immutable object by setting a value for thenodeattribute.final ImmutableServiceCheckwithService(Service value) Copy the current immutable object by setting a value for theserviceattribute.
-
Method Details
-
getNode
- Specified by:
getNodein classServiceCheck- Returns:
- The value of the
nodeattribute
-
getService
- Specified by:
getServicein classServiceCheck- Returns:
- The value of the
serviceattribute
-
getChecks
- Specified by:
getChecksin classServiceCheck- 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 ofImmutableServiceCheckthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:node,service,checks. -
toString
Prints the immutable valueServiceCheckwith attribute values. -
copyOf
Creates an immutable copy of aServiceCheckvalue. 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 ServiceCheck instance
-
builder
Creates a builder forImmutableServiceCheck.ImmutableServiceCheck.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 ImmutableServiceCheck builder
-