Package com.orbitz.consul.model.catalog
Class ImmutableServiceWeights.Builder
- java.lang.Object
-
- com.orbitz.consul.model.catalog.ImmutableServiceWeights.Builder
-
- Enclosing class:
- ImmutableServiceWeights
@NotThreadSafe public static final class ImmutableServiceWeights.Builder extends java.lang.ObjectBuilds instances of typeImmutableServiceWeights. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
Modifier and Type Method Description ImmutableServiceWeightsbuild()Builds a newImmutableServiceWeights.ImmutableServiceWeights.Builderfrom(ServiceWeights instance)Fill a builder with attribute values from the providedServiceWeightsinstance.ImmutableServiceWeights.Builderpassing(int passing)Initializes the value for thepassingattribute.ImmutableServiceWeights.Builderwarning(int warning)Initializes the value for thewarningattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableServiceWeights.Builder from(ServiceWeights instance)
Fill a builder with attribute values from the providedServiceWeightsinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
passing
@CanIgnoreReturnValue public final ImmutableServiceWeights.Builder passing(int passing)
Initializes the value for thepassingattribute.- Parameters:
passing- The value for passing- Returns:
thisbuilder for use in a chained invocation
-
warning
@CanIgnoreReturnValue public final ImmutableServiceWeights.Builder warning(int warning)
Initializes the value for thewarningattribute.- Parameters:
warning- The value for warning- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableServiceWeights build()
Builds a newImmutableServiceWeights.- Returns:
- An immutable instance of ServiceWeights
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-