Package com.orbitz.consul.option
Class ImmutableQueryOptions.Builder
- java.lang.Object
-
- com.orbitz.consul.option.ImmutableQueryOptions.Builder
-
- Enclosing class:
- ImmutableQueryOptions
@NotThreadSafe public static final class ImmutableQueryOptions.Builder extends java.lang.ObjectBuilds instances of typeImmutableQueryOptions. 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 ImmutableQueryOptions.BuilderaddAllNodeMeta(java.lang.Iterable<java.lang.String> elements)Adds elements tonodeMetalist.ImmutableQueryOptions.BuilderaddAllTag(java.lang.Iterable<java.lang.String> elements)Adds elements totaglist.ImmutableQueryOptions.BuilderaddNodeMeta(java.lang.String element)Adds one element tonodeMetalist.ImmutableQueryOptions.BuilderaddNodeMeta(java.lang.String... elements)Adds elements tonodeMetalist.ImmutableQueryOptions.BuilderaddTag(java.lang.String element)Adds one element totaglist.ImmutableQueryOptions.BuilderaddTag(java.lang.String... elements)Adds elements totaglist.ImmutableQueryOptionsbuild()Builds a newImmutableQueryOptions.ImmutableQueryOptions.BuilderconsistencyMode(ConsistencyMode consistencyMode)Initializes the value for theconsistencyModeattribute.ImmutableQueryOptions.Builderdatacenter(java.lang.String datacenter)Initializes the optional valuedatacenterto datacenter.ImmutableQueryOptions.Builderdatacenter(java.util.Optional<java.lang.String> datacenter)Initializes the optional valuedatacenterto datacenter.ImmutableQueryOptions.Builderfrom(QueryOptions instance)Fill a builder with attribute values from the providedQueryOptionsinstance.ImmutableQueryOptions.Builderhash(java.lang.String hash)Initializes the optional valuehashto hash.ImmutableQueryOptions.Builderhash(java.util.Optional<java.lang.String> hash)Initializes the optional valuehashto hash.ImmutableQueryOptions.Builderindex(java.math.BigInteger index)Initializes the optional valueindexto index.ImmutableQueryOptions.Builderindex(java.util.Optional<? extends java.math.BigInteger> index)Initializes the optional valueindexto index.ImmutableQueryOptions.Buildernear(java.lang.String near)Initializes the optional valuenearto near.ImmutableQueryOptions.Buildernear(java.util.Optional<java.lang.String> near)Initializes the optional valuenearto near.ImmutableQueryOptions.BuildernodeMeta(java.lang.Iterable<java.lang.String> elements)Sets or replaces all elements fornodeMetalist.ImmutableQueryOptions.Buildertag(java.lang.Iterable<java.lang.String> elements)Sets or replaces all elements fortaglist.ImmutableQueryOptions.Buildertoken(java.lang.String token)Initializes the optional valuetokento token.ImmutableQueryOptions.Buildertoken(java.util.Optional<java.lang.String> token)Initializes the optional valuetokento token.ImmutableQueryOptions.Builderwait(java.lang.String wait)Initializes the optional valuewaitto wait.ImmutableQueryOptions.Builderwait(java.util.Optional<java.lang.String> wait)Initializes the optional valuewaitto wait.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder from(QueryOptions instance)
Fill a builder with attribute values from the providedQueryOptionsinstance. 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
-
wait
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder wait(java.lang.String wait)
Initializes the optional valuewaitto wait.- Parameters:
wait- The value for wait- Returns:
thisbuilder for chained invocation
-
wait
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder wait(java.util.Optional<java.lang.String> wait)
Initializes the optional valuewaitto wait.- Parameters:
wait- The value for wait- Returns:
thisbuilder for use in a chained invocation
-
token
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder token(java.lang.String token)
Initializes the optional valuetokento token.- Parameters:
token- The value for token- Returns:
thisbuilder for chained invocation
-
token
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder token(java.util.Optional<java.lang.String> token)
Initializes the optional valuetokento token.- Parameters:
token- The value for token- Returns:
thisbuilder for use in a chained invocation
-
hash
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder hash(java.lang.String hash)
Initializes the optional valuehashto hash.- Parameters:
hash- The value for hash- Returns:
thisbuilder for chained invocation
-
hash
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder hash(java.util.Optional<java.lang.String> hash)
Initializes the optional valuehashto hash.- Parameters:
hash- The value for hash- Returns:
thisbuilder for use in a chained invocation
-
index
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder index(java.math.BigInteger index)
Initializes the optional valueindexto index.- Parameters:
index- The value for index- Returns:
thisbuilder for chained invocation
-
index
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder index(java.util.Optional<? extends java.math.BigInteger> index)
Initializes the optional valueindexto index.- Parameters:
index- The value for index- Returns:
thisbuilder for use in a chained invocation
-
near
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder near(java.lang.String near)
Initializes the optional valuenearto near.- Parameters:
near- The value for near- Returns:
thisbuilder for chained invocation
-
near
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder near(java.util.Optional<java.lang.String> near)
Initializes the optional valuenearto near.- Parameters:
near- The value for near- Returns:
thisbuilder for use in a chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder datacenter(java.lang.String datacenter)
Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder datacenter(java.util.Optional<java.lang.String> datacenter)
Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for use in a chained invocation
-
addNodeMeta
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addNodeMeta(java.lang.String element)
Adds one element tonodeMetalist.- Parameters:
element- A nodeMeta element- Returns:
thisbuilder for use in a chained invocation
-
addNodeMeta
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addNodeMeta(java.lang.String... elements)
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(java.lang.Iterable<java.lang.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(java.lang.Iterable<java.lang.String> elements)
Adds elements tonodeMetalist.- Parameters:
elements- An iterable of nodeMeta elements- Returns:
thisbuilder for use in a chained invocation
-
addTag
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addTag(java.lang.String element)
Adds one element totaglist.- Parameters:
element- A tag element- Returns:
thisbuilder for use in a chained invocation
-
addTag
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder addTag(java.lang.String... elements)
Adds elements totaglist.- Parameters:
elements- An array of tag elements- Returns:
thisbuilder for use in a chained invocation
-
tag
@CanIgnoreReturnValue public final ImmutableQueryOptions.Builder tag(java.lang.Iterable<java.lang.String> elements)
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(java.lang.Iterable<java.lang.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
public ImmutableQueryOptions build()
Builds a newImmutableQueryOptions.- Returns:
- An immutable instance of QueryOptions
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-