Package com.orbitz.consul.model.health
Class ImmutableServiceCheck.Builder
- java.lang.Object
-
- com.orbitz.consul.model.health.ImmutableServiceCheck.Builder
-
- Enclosing class:
- ImmutableServiceCheck
@NotThreadSafe public static final class ImmutableServiceCheck.Builder extends java.lang.ObjectBuilds instances of typeImmutableServiceCheck. 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 ImmutableServiceCheck.BuilderaddAllChecks(java.lang.Iterable<? extends HealthCheck> elements)Adds elements tocheckslist.ImmutableServiceCheck.BuilderaddChecks(HealthCheck element)Adds one element tocheckslist.ImmutableServiceCheck.BuilderaddChecks(HealthCheck... elements)Adds elements tocheckslist.ImmutableServiceCheckbuild()Builds a newImmutableServiceCheck.ImmutableServiceCheck.Builderchecks(java.lang.Iterable<? extends HealthCheck> elements)Sets or replaces all elements forcheckslist.ImmutableServiceCheck.Builderfrom(ServiceCheck instance)Fill a builder with attribute values from the providedServiceCheckinstance.ImmutableServiceCheck.Buildernode(Node node)Initializes the value for thenodeattribute.ImmutableServiceCheck.Builderservice(Service service)Initializes the value for theserviceattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableServiceCheck.Builder from(ServiceCheck instance)
Fill a builder with attribute values from the providedServiceCheckinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
node
@CanIgnoreReturnValue public final ImmutableServiceCheck.Builder node(Node node)
Initializes the value for thenodeattribute.- Parameters:
node- The value for node- Returns:
thisbuilder for use in a chained invocation
-
service
@CanIgnoreReturnValue public final ImmutableServiceCheck.Builder service(Service service)
Initializes the value for theserviceattribute.- Parameters:
service- The value for service- Returns:
thisbuilder for use in a chained invocation
-
addChecks
@CanIgnoreReturnValue public final ImmutableServiceCheck.Builder addChecks(HealthCheck element)
Adds one element tocheckslist.- Parameters:
element- A checks element- Returns:
thisbuilder for use in a chained invocation
-
addChecks
@CanIgnoreReturnValue public final ImmutableServiceCheck.Builder addChecks(HealthCheck... elements)
Adds elements tocheckslist.- Parameters:
elements- An array of checks elements- Returns:
thisbuilder for use in a chained invocation
-
checks
@CanIgnoreReturnValue public final ImmutableServiceCheck.Builder checks(java.lang.Iterable<? extends HealthCheck> elements)
Sets or replaces all elements forcheckslist.- Parameters:
elements- An iterable of checks elements- Returns:
thisbuilder for use in a chained invocation
-
addAllChecks
@CanIgnoreReturnValue public final ImmutableServiceCheck.Builder addAllChecks(java.lang.Iterable<? extends HealthCheck> elements)
Adds elements tocheckslist.- Parameters:
elements- An iterable of checks elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableServiceCheck build()
Builds a newImmutableServiceCheck.- Returns:
- An immutable instance of ServiceCheck
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-