Package com.orbitz.consul.cache
Class ImmutableServiceHealthKey
- java.lang.Object
-
- com.orbitz.consul.cache.ServiceHealthKey
-
- com.orbitz.consul.cache.ImmutableServiceHealthKey
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableServiceHealthKey extends ServiceHealthKeyImmutable implementation ofServiceHealthKey.Use the builder to create immutable instances:
ImmutableServiceHealthKey.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableServiceHealthKey.BuilderBuilds instances of typeImmutableServiceHealthKey.
-
Method Summary
Modifier and Type Method Description static ImmutableServiceHealthKey.Builderbuilder()Creates a builder forImmutableServiceHealthKey.static ImmutableServiceHealthKeycopyOf(ServiceHealthKey instance)Creates an immutable copy of aServiceHealthKeyvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableServiceHealthKeythat have equal attribute values.java.lang.StringgetHost()java.lang.IntegergetPort()java.lang.StringgetServiceId()inthashCode()Computes a hash code from attributes:serviceId,host,port.java.lang.StringtoString()Prints the immutable valueServiceHealthKeywith attribute values.ImmutableServiceHealthKeywithHost(java.lang.String value)Copy the current immutable object by setting a value for thehostattribute.ImmutableServiceHealthKeywithPort(java.lang.Integer value)Copy the current immutable object by setting a value for theportattribute.ImmutableServiceHealthKeywithServiceId(java.lang.String value)Copy the current immutable object by setting a value for theserviceIdattribute.-
Methods inherited from class com.orbitz.consul.cache.ServiceHealthKey
fromServiceHealth, of
-
-
-
-
Method Detail
-
getServiceId
public java.lang.String getServiceId()
- Specified by:
getServiceIdin classServiceHealthKey- Returns:
- The value of the
serviceIdattribute
-
getHost
public java.lang.String getHost()
- Specified by:
getHostin classServiceHealthKey- Returns:
- The value of the
hostattribute
-
getPort
public java.lang.Integer getPort()
- Specified by:
getPortin classServiceHealthKey- Returns:
- The value of the
portattribute
-
withServiceId
public final ImmutableServiceHealthKey withServiceId(java.lang.String value)
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
public final ImmutableServiceHealthKey withHost(java.lang.String value)
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
public final ImmutableServiceHealthKey withPort(java.lang.Integer value)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableServiceHealthKeythat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:serviceId,host,port.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueServiceHealthKeywith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableServiceHealthKey copyOf(ServiceHealthKey instance)
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
public static ImmutableServiceHealthKey.Builder builder()
Creates a builder forImmutableServiceHealthKey.ImmutableServiceHealthKey.builder() .serviceId(String) // requiredserviceId.host(String) // requiredhost.port(Integer) // requiredport.build();- Returns:
- A new ImmutableServiceHealthKey builder
-
-