Package org.kiwiproject.consul.option
Class ImmutableTransactionOptions.Builder
java.lang.Object
org.kiwiproject.consul.option.ImmutableTransactionOptions.Builder
- Enclosing class:
- ImmutableTransactionOptions
Builds instances of type
ImmutableTransactionOptions.
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 TypeMethodDescriptionaddAllToQueryParameters(Iterable<String> elements) Adds elements totoQueryParameterslist.addToQueryParameters(String element) Adds one element totoQueryParameterslist.addToQueryParameters(String... elements) Adds elements totoQueryParameterslist.build()Builds a newImmutableTransactionOptions.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.from(ParamAdder instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.ParamAdderinstance.from(TransactionOptions instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.TransactionOptionsinstance.toQueryParameters(Iterable<String> elements) Sets or replaces all elements fortoQueryParameterslist.
-
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
@CanIgnoreReturnValue public final ImmutableTransactionOptions.Builder from(TransactionOptions instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.TransactionOptionsinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
addToQueryParameters
@CanIgnoreReturnValue public final ImmutableTransactionOptions.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 ImmutableTransactionOptions.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 ImmutableTransactionOptions.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 ImmutableTransactionOptions.Builder addAllToQueryParameters(Iterable<String> elements) Adds elements totoQueryParameterslist.- Parameters:
elements- An iterable of toQueryParameters elements- Returns:
thisbuilder for use in a chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableTransactionOptions.Builder datacenter(String datacenter) Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableTransactionOptions.Builder datacenter(Optional<String> datacenter) Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for use in a chained invocation
-
consistencyMode
@CanIgnoreReturnValue public final ImmutableTransactionOptions.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 newImmutableTransactionOptions.- Returns:
- An immutable instance of TransactionOptions
- Throws:
IllegalStateException- if any required attributes are missing
-