Package org.kiwiproject.consul.option
Class ImmutableQueryOptions.Builder
java.lang.Object
org.kiwiproject.consul.option.ImmutableQueryOptions.Builder
- Enclosing class:
- ImmutableQueryOptions
Builds instances of type
ImmutableQueryOptions.
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 TypeMethodDescriptionaddAllNodeMeta(Iterable<String> elements) Adds elements tonodeMetalist.Adds elements totaglist.addAllToQueryParameters(Iterable<String> elements) Adds elements totoQueryParameterslist.addNodeMeta(String element) Adds one element tonodeMetalist.addNodeMeta(String... elements) Adds elements tonodeMetalist.Adds one element totaglist.Adds elements totaglist.addToQueryParameters(String element) Adds one element totoQueryParameterslist.addToQueryParameters(String... elements) Adds elements totoQueryParameterslist.build()Builds a newImmutableQueryOptions.consistencyMode(ConsistencyMode consistencyMode) Initializes the value for theconsistencyModeattribute.datacenter(String datacenter) Initializes the optional valuedatacenterto datacenter.datacenter(Optional<String> datacenter) Initializes the optional valuedatacenterto datacenter.enable(boolean enable) Initializes the optional valueenableto enable.Initializes the optional valueenableto enable.Initializes the optional valuefilterto filter.Initializes the optional valuefilterto filter.from(ParamAdder instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.ParamAdderinstance.from(QueryOptions instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.QueryOptionsinstance.Initializes the optional valuehashto hash.Initializes the optional valuehashto hash.index(BigInteger index) Initializes the optional valueindexto index.index(Optional<? extends BigInteger> index) Initializes the optional valueindexto index.Initializes the optional valuenamespaceto namespace.Initializes the optional valuenamespaceto namespace.Initializes the optional valuenearto near.Initializes the optional valuenearto near.Sets or replaces all elements fornodeMetalist.Initializes the optional valuenoteto note.Initializes the optional valuenoteto note.Initializes the optional valuereasonto reason.Initializes the optional valuereasonto reason.Initializes the optional valuesegmentto segment.Initializes the optional valuesegmentto segment.Sets or replaces all elements fortaglist.Initializes the optional valuetokento token.Initializes the optional valuetokento token.toQueryParameters(Iterable<String> elements) Sets or replaces all elements fortoQueryParameterslist.Initializes the optional valuewaitto wait.Initializes the optional valuewaitto wait.wan(boolean wan) Initializes the optional valuewanto wan.Initializes the optional valuewanto wan.
-
Method Details
-
from
Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.ParamAdderinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.QueryOptionsinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
addToQueryParameters
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addToQueryParameters(String element) Adds one element totoQueryParameterslist.- Parameters:
element- A toQueryParameters element- Returns:
thisbuilder for use in a chained invocation
-
addToQueryParameters
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addToQueryParameters(String... elements) Adds elements totoQueryParameterslist.- Parameters:
elements- An array of toQueryParameters elements- Returns:
thisbuilder for use in a chained invocation
-
toQueryParameters
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder toQueryParameters(Iterable<String> elements) Sets or replaces all elements fortoQueryParameterslist.- Parameters:
elements- An iterable of toQueryParameters elements- Returns:
thisbuilder for use in a chained invocation
-
addAllToQueryParameters
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addAllToQueryParameters(Iterable<String> elements) Adds elements totoQueryParameterslist.- Parameters:
elements- An iterable of toQueryParameters elements- Returns:
thisbuilder for use in a chained invocation
-
wait
Initializes the optional valuewaitto wait.- Parameters:
wait- The value for wait- Returns:
thisbuilder for chained invocation
-
wait
Initializes the optional valuewaitto wait.- Parameters:
wait- The value for wait- Returns:
thisbuilder for use in a chained invocation
-
token
Initializes the optional valuetokento token.- Parameters:
token- The value for token- Returns:
thisbuilder for chained invocation
-
token
Initializes the optional valuetokento token.- Parameters:
token- The value for token- Returns:
thisbuilder for use in a chained invocation
-
hash
Initializes the optional valuehashto hash.- Parameters:
hash- The value for hash- Returns:
thisbuilder for chained invocation
-
hash
Initializes the optional valuehashto hash.- Parameters:
hash- The value for hash- Returns:
thisbuilder for use in a chained invocation
-
index
Initializes the optional valueindexto index.- Parameters:
index- The value for index- Returns:
thisbuilder for chained invocation
-
index
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder index(Optional<? extends BigInteger> index) Initializes the optional valueindexto index.- Parameters:
index- The value for index- Returns:
thisbuilder for use in a chained invocation
-
near
Initializes the optional valuenearto near.- Parameters:
near- The value for near- Returns:
thisbuilder for chained invocation
-
near
Initializes the optional valuenearto near.- Parameters:
near- The value for near- Returns:
thisbuilder for use in a chained invocation
-
datacenter
Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder datacenter(Optional<String> datacenter) Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for use in a chained invocation
-
filter
Initializes the optional valuefilterto filter.- Parameters:
filter- The value for filter- Returns:
thisbuilder for chained invocation
-
filter
Initializes the optional valuefilterto filter.- Parameters:
filter- The value for filter- Returns:
thisbuilder for use in a chained invocation
-
namespace
Initializes the optional valuenamespaceto namespace.- Parameters:
namespace- The value for namespace- Returns:
thisbuilder for chained invocation
-
namespace
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder namespace(Optional<String> namespace) Initializes the optional valuenamespaceto namespace.- Parameters:
namespace- The value for namespace- Returns:
thisbuilder for use in a chained invocation
-
wan
Initializes the optional valuewanto wan.- Parameters:
wan- The value for wan- Returns:
thisbuilder for chained invocation
-
wan
Initializes the optional valuewanto wan.- Parameters:
wan- The value for wan- Returns:
thisbuilder for use in a chained invocation
-
segment
Initializes the optional valuesegmentto segment.- Parameters:
segment- The value for segment- Returns:
thisbuilder for chained invocation
-
segment
Initializes the optional valuesegmentto segment.- Parameters:
segment- The value for segment- Returns:
thisbuilder for use in a chained invocation
-
note
Initializes the optional valuenoteto note.- Parameters:
note- The value for note- Returns:
thisbuilder for chained invocation
-
note
Initializes the optional valuenoteto note.- Parameters:
note- The value for note- Returns:
thisbuilder for use in a chained invocation
-
enable
Initializes the optional valueenableto enable.- Parameters:
enable- The value for enable- Returns:
thisbuilder for chained invocation
-
enable
Initializes the optional valueenableto enable.- Parameters:
enable- The value for enable- Returns:
thisbuilder for use in a chained invocation
-
reason
Initializes the optional valuereasonto reason.- Parameters:
reason- The value for reason- Returns:
thisbuilder for chained invocation
-
reason
Initializes the optional valuereasonto reason.- Parameters:
reason- The value for reason- Returns:
thisbuilder for use in a chained invocation
-
addNodeMeta
Adds one element tonodeMetalist.- Parameters:
element- A nodeMeta element- Returns:
thisbuilder for use in a chained invocation
-
addNodeMeta
Adds elements tonodeMetalist.- Parameters:
elements- An array of nodeMeta elements- Returns:
thisbuilder for use in a chained invocation
-
nodeMeta
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder nodeMeta(Iterable<String> elements) Sets or replaces all elements fornodeMetalist.- Parameters:
elements- An iterable of nodeMeta elements- Returns:
thisbuilder for use in a chained invocation
-
addAllNodeMeta
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addAllNodeMeta(Iterable<String> elements) Adds elements tonodeMetalist.- Parameters:
elements- An iterable of nodeMeta elements- Returns:
thisbuilder for use in a chained invocation
-
addTag
Adds one element totaglist.- Parameters:
element- A tag element- Returns:
thisbuilder for use in a chained invocation
-
addTag
Adds elements totaglist.- Parameters:
elements- An array of tag elements- Returns:
thisbuilder for use in a chained invocation
-
tag
Sets or replaces all elements fortaglist.- Parameters:
elements- An iterable of tag elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTag
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addAllTag(Iterable<String> elements) Adds elements totaglist.- Parameters:
elements- An iterable of tag elements- Returns:
thisbuilder for use in a chained invocation
-
consistencyMode
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder consistencyMode(ConsistencyMode consistencyMode) Initializes the value for theconsistencyModeattribute.If not set, this attribute will have a default value as returned by the initializer of
consistencyMode.- Parameters:
consistencyMode- The value for consistencyMode- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableQueryOptions.- Returns:
- An immutable instance of QueryOptions
- Throws:
IllegalStateException- if any required attributes are missing
-