Package com.orbitz.consul.model.health
Class ImmutableServiceHealth
- java.lang.Object
-
- com.orbitz.consul.model.health.ServiceHealth
-
- com.orbitz.consul.model.health.ImmutableServiceHealth
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableServiceHealth extends ServiceHealthImmutable implementation ofServiceHealth.Use the builder to create immutable instances:
ImmutableServiceHealth.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableServiceHealth.BuilderBuilds instances of typeImmutableServiceHealth.
-
Method Summary
Modifier and Type Method Description static ImmutableServiceHealth.Builderbuilder()Creates a builder forImmutableServiceHealth.static ImmutableServiceHealthcopyOf(ServiceHealth instance)Creates an immutable copy of aServiceHealthvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableServiceHealththat have equal attribute values.com.google.common.collect.ImmutableList<HealthCheck>getChecks()NodegetNode()ServicegetService()inthashCode()Computes a hash code from attributes:node,service,checks.java.lang.StringtoString()Prints the immutable valueServiceHealthwith attribute values.ImmutableServiceHealthwithChecks(HealthCheck... elements)Copy the current immutable object with elements that replace the content ofchecks.ImmutableServiceHealthwithChecks(java.lang.Iterable<? extends HealthCheck> elements)Copy the current immutable object with elements that replace the content ofchecks.ImmutableServiceHealthwithNode(Node value)Copy the current immutable object by setting a value for thenodeattribute.ImmutableServiceHealthwithService(Service value)Copy the current immutable object by setting a value for theserviceattribute.
-
-
-
Method Detail
-
getNode
public Node getNode()
- Specified by:
getNodein classServiceHealth- Returns:
- The value of the
nodeattribute
-
getService
public Service getService()
- Specified by:
getServicein classServiceHealth- Returns:
- The value of the
serviceattribute
-
getChecks
public com.google.common.collect.ImmutableList<HealthCheck> getChecks()
- Specified by:
getChecksin classServiceHealth- Returns:
- The value of the
checksattribute
-
withNode
public final ImmutableServiceHealth withNode(Node value)
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
public final ImmutableServiceHealth withService(Service value)
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
public final ImmutableServiceHealth withChecks(HealthCheck... elements)
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
public final ImmutableServiceHealth withChecks(java.lang.Iterable<? extends HealthCheck> elements)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableServiceHealththat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:node,service,checks.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueServiceHealthwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableServiceHealth copyOf(ServiceHealth instance)
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
public static ImmutableServiceHealth.Builder builder()
Creates a builder forImmutableServiceHealth.ImmutableServiceHealth.builder() .node(com.orbitz.consul.model.health.Node) // requirednode.service(com.orbitz.consul.model.health.Service) // requiredservice.addChecks|addAllChecks(com.orbitz.consul.model.health.HealthCheck) //checkselements .build();- Returns:
- A new ImmutableServiceHealth builder
-
-