Package org.kiwiproject.consul.cache
Class ImmutableServiceHealthKey
java.lang.Object
org.kiwiproject.consul.cache.ServiceHealthKey
org.kiwiproject.consul.cache.ImmutableServiceHealthKey
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableServiceHealthKey
extends ServiceHealthKey
Immutable implementation of
ServiceHealthKey.
Use the builder to create immutable instances:
ImmutableServiceHealthKey.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableServiceHealthKey. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableServiceHealthKey.static ImmutableServiceHealthKeycopyOf(ServiceHealthKey instance) Creates an immutable copy of aServiceHealthKeyvalue.booleanThis instance is equal to all instances ofImmutableServiceHealthKeythat have equal attribute values.getHost()getPort()inthashCode()Computes a hash code from attributes:serviceId,host,port.toString()Prints the immutable valueServiceHealthKeywith attribute values.Copy the current immutable object by setting a value for thehostattribute.Copy the current immutable object by setting a value for theportattribute.withServiceId(String value) Copy the current immutable object by setting a value for theserviceIdattribute.Methods inherited from class org.kiwiproject.consul.cache.ServiceHealthKey
fromServiceHealth, of
-
Method Details
-
getServiceId
- Specified by:
getServiceIdin classServiceHealthKey- Returns:
- The value of the
serviceIdattribute
-
getHost
- Specified by:
getHostin classServiceHealthKey- Returns:
- The value of the
hostattribute
-
getPort
- Specified by:
getPortin classServiceHealthKey- Returns:
- The value of the
portattribute
-
withServiceId
Copy the current immutable object by setting a value for theserviceIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for serviceId- Returns:
- A modified copy of the
thisobject
-
withHost
Copy the current immutable object by setting a value for thehostattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for host- Returns:
- A modified copy of the
thisobject
-
withPort
Copy the current immutable object by setting a value for theportattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for port- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableServiceHealthKeythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:serviceId,host,port. -
toString
Prints the immutable valueServiceHealthKeywith attribute values. -
copyOf
Creates an immutable copy of aServiceHealthKeyvalue. 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 ServiceHealthKey instance
-
builder
Creates a builder forImmutableServiceHealthKey.ImmutableServiceHealthKey.builder() .serviceId(String) // requiredserviceId.host(String) // requiredhost.port(Integer) // requiredport.build();- Returns:
- A new ImmutableServiceHealthKey builder
-