Class ImmutableServiceWeights
java.lang.Object
org.kiwiproject.consul.model.catalog.ServiceWeights
org.kiwiproject.consul.model.catalog.ImmutableServiceWeights
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableServiceWeights
extends ServiceWeights
Immutable implementation of
ServiceWeights.
Use the builder to create immutable instances:
ImmutableServiceWeights.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableServiceWeights. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableServiceWeights.static ImmutableServiceWeightscopyOf(ServiceWeights instance) Creates an immutable copy of aServiceWeightsvalue.booleanThis instance is equal to all instances ofImmutableServiceWeightsthat have equal attribute values.intintinthashCode()Computes a hash code from attributes:passing,warning.toString()Prints the immutable valueServiceWeightswith attribute values.final ImmutableServiceWeightswithPassing(int value) Copy the current immutable object by setting a value for thepassingattribute.final ImmutableServiceWeightswithWarning(int value) Copy the current immutable object by setting a value for thewarningattribute.
-
Method Details
-
getPassing
public int getPassing()- Specified by:
getPassingin classServiceWeights- Returns:
- The value of the
passingattribute
-
getWarning
public int getWarning()- Specified by:
getWarningin classServiceWeights- Returns:
- The value of the
warningattribute
-
withPassing
Copy the current immutable object by setting a value for thepassingattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for passing- Returns:
- A modified copy of the
thisobject
-
withWarning
Copy the current immutable object by setting a value for thewarningattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for warning- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableServiceWeightsthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:passing,warning. -
toString
Prints the immutable valueServiceWeightswith attribute values. -
copyOf
Creates an immutable copy of aServiceWeightsvalue. 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 ServiceWeights instance
-
builder
Creates a builder forImmutableServiceWeights.ImmutableServiceWeights.builder() .passing(int) // requiredpassing.warning(int) // requiredwarning.build();- Returns:
- A new ImmutableServiceWeights builder
-