Class ImmutableServiceWeights.Builder
java.lang.Object
org.kiwiproject.consul.model.catalog.ImmutableServiceWeights.Builder
- Enclosing class:
- ImmutableServiceWeights
Builds instances of type
ImmutableServiceWeights.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is 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 TypeMethodDescriptionbuild()Builds a newImmutableServiceWeights.from(ServiceWeights instance) Fill a builder with attribute values from the providedServiceWeightsinstance.passing(int passing) Initializes the value for thepassingattribute.warning(int warning) Initializes the value for thewarningattribute.
-
Method Details
-
from
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
Initializes the value for thepassingattribute.- Parameters:
passing- The value for passing- Returns:
thisbuilder for use in a chained invocation
-
warning
Initializes the value for thewarningattribute.- Parameters:
warning- The value for warning- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableServiceWeights.- Returns:
- An immutable instance of ServiceWeights
- Throws:
IllegalStateException- if any required attributes are missing
-