Package com.orbitz.consul.model.catalog
Class ImmutableServiceWeights
- java.lang.Object
-
- com.orbitz.consul.model.catalog.ServiceWeights
-
- com.orbitz.consul.model.catalog.ImmutableServiceWeights
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableServiceWeights extends ServiceWeightsImmutable implementation ofServiceWeights.Use the builder to create immutable instances:
ImmutableServiceWeights.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableServiceWeights.BuilderBuilds instances of typeImmutableServiceWeights.
-
Method Summary
Modifier and Type Method Description static ImmutableServiceWeights.Builderbuilder()Creates a builder forImmutableServiceWeights.static ImmutableServiceWeightscopyOf(ServiceWeights instance)Creates an immutable copy of aServiceWeightsvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableServiceWeightsthat have equal attribute values.intgetPassing()intgetWarning()inthashCode()Computes a hash code from attributes:passing,warning.java.lang.StringtoString()Prints the immutable valueServiceWeightswith attribute values.ImmutableServiceWeightswithPassing(int value)Copy the current immutable object by setting a value for thepassingattribute.ImmutableServiceWeightswithWarning(int value)Copy the current immutable object by setting a value for thewarningattribute.
-
-
-
Method Detail
-
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
public final ImmutableServiceWeights withPassing(int value)
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
public final ImmutableServiceWeights withWarning(int value)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableServiceWeightsthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:passing,warning.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueServiceWeightswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableServiceWeights copyOf(ServiceWeights instance)
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
public static ImmutableServiceWeights.Builder builder()
Creates a builder forImmutableServiceWeights.ImmutableServiceWeights.builder() .passing(int) // requiredpassing.warning(int) // requiredwarning.build();- Returns:
- A new ImmutableServiceWeights builder
-
-