Class ImmutableServiceQuery.Builder
java.lang.Object
org.kiwiproject.consul.model.query.ImmutableServiceQuery.Builder
- Enclosing class:
- ImmutableServiceQuery
Builds instances of type
ImmutableServiceQuery.
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 newImmutableServiceQuery.Initializes the optional valuefailoverto failover.Initializes the optional valuefailoverto failover.from(ServiceQuery instance) Fill a builder with attribute values from the providedServiceQueryinstance.onlyPassing(boolean onlyPassing) Initializes the optional valueonlyPassingto onlyPassing.onlyPassing(Optional<Boolean> onlyPassing) Initializes the optional valueonlyPassingto onlyPassing.Initializes the value for theserviceattribute.Initializes the optional valuetagsto tags.Initializes the optional valuetagsto tags.
-
Method Details
-
from
Fill a builder with attribute values from the providedServiceQueryinstance. 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
-
service
Initializes the value for theserviceattribute.- Parameters:
service- The value for service- Returns:
thisbuilder for use in a chained invocation
-
onlyPassing
Initializes the optional valueonlyPassingto onlyPassing.- Parameters:
onlyPassing- The value for onlyPassing- Returns:
thisbuilder for chained invocation
-
onlyPassing
@CanIgnoreReturnValue public final ImmutableServiceQuery.Builder onlyPassing(Optional<Boolean> onlyPassing) Initializes the optional valueonlyPassingto onlyPassing.- Parameters:
onlyPassing- The value for onlyPassing- Returns:
thisbuilder for use in a chained invocation
-
tags
Initializes the optional valuetagsto tags.- Parameters:
tags- The value for tags- Returns:
thisbuilder for chained invocation
-
tags
@CanIgnoreReturnValue public final ImmutableServiceQuery.Builder tags(Optional<? extends List<String>> tags) Initializes the optional valuetagsto tags.- Parameters:
tags- The value for tags- Returns:
thisbuilder for use in a chained invocation
-
failover
Initializes the optional valuefailoverto failover.- Parameters:
failover- The value for failover- Returns:
thisbuilder for chained invocation
-
failover
@CanIgnoreReturnValue public final ImmutableServiceQuery.Builder failover(Optional<? extends Failover> failover) Initializes the optional valuefailoverto failover.- Parameters:
failover- The value for failover- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableServiceQuery.- Returns:
- An immutable instance of ServiceQuery
- Throws:
IllegalStateException- if any required attributes are missing
-