Package org.kiwiproject.consul.option
Class ImmutablePutOptions.Builder
java.lang.Object
org.kiwiproject.consul.option.ImmutablePutOptions.Builder
- Enclosing class:
- ImmutablePutOptions
Builds instances of type
ImmutablePutOptions.
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 TypeMethodDescriptionInitializes the optional valueacquireto acquire.Initializes the optional valueacquireto acquire.addAllToQueryParameters(Iterable<String> elements) Adds elements totoQueryParameterslist.addToQueryParameters(String element) Adds one element totoQueryParameterslist.addToQueryParameters(String... elements) Adds elements totoQueryParameterslist.build()Builds a newImmutablePutOptions.cas(long cas) Initializes the optional valuecasto cas.Initializes the optional valuecasto cas.Initializes the optional valuedcto dc.Initializes the optional valuedcto dc.from(ParamAdder instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.ParamAdderinstance.from(PutOptions instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.PutOptionsinstance.putAllToHeaders(Map<String, ? extends String> entries) Put all mappings from the specified map as entries totoHeadersmap.putToHeaders(String key, String value) Put one entry to thetoHeadersmap.putToHeaders(Map.Entry<String, ? extends String> entry) Put one entry to thetoHeadersmap.Initializes the optional valuereleaseto release.Initializes the optional valuereleaseto release.Sets or replaces all mappings from the specified map as entries for thetoHeadersmap.Initializes the optional valuetokento token.Initializes the optional valuetokento token.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
Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.PutOptionsinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
addToQueryParameters
Adds one element totoQueryParameterslist.- Parameters:
element- A toQueryParameters element- Returns:
thisbuilder for use in a chained invocation
-
addToQueryParameters
@CanIgnoreReturnValue public final ImmutablePutOptions.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 ImmutablePutOptions.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 ImmutablePutOptions.Builder addAllToQueryParameters(Iterable<String> elements) Adds elements totoQueryParameterslist.- Parameters:
elements- An iterable of toQueryParameters elements- Returns:
thisbuilder for use in a chained invocation
-
putToHeaders
@CanIgnoreReturnValue public final ImmutablePutOptions.Builder putToHeaders(String key, String value) Put one entry to thetoHeadersmap.- Parameters:
key- The key in the toHeaders mapvalue- The associated value in the toHeaders map- Returns:
thisbuilder for use in a chained invocation
-
putToHeaders
@CanIgnoreReturnValue public final ImmutablePutOptions.Builder putToHeaders(Map.Entry<String, ? extends String> entry) Put one entry to thetoHeadersmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
toHeaders
@CanIgnoreReturnValue public final ImmutablePutOptions.Builder toHeaders(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for thetoHeadersmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the toHeaders map- Returns:
thisbuilder for use in a chained invocation
-
putAllToHeaders
@CanIgnoreReturnValue public final ImmutablePutOptions.Builder putAllToHeaders(Map<String, ? extends String> entries) Put all mappings from the specified map as entries totoHeadersmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the toHeaders map- Returns:
thisbuilder for use in a chained invocation
-
cas
Initializes the optional valuecasto cas.- Parameters:
cas- The value for cas- Returns:
thisbuilder for chained invocation
-
cas
Initializes the optional valuecasto cas.- Parameters:
cas- The value for cas- Returns:
thisbuilder for use in a chained invocation
-
acquire
Initializes the optional valueacquireto acquire.- Parameters:
acquire- The value for acquire- Returns:
thisbuilder for chained invocation
-
acquire
Initializes the optional valueacquireto acquire.- Parameters:
acquire- The value for acquire- Returns:
thisbuilder for use in a chained invocation
-
release
Initializes the optional valuereleaseto release.- Parameters:
release- The value for release- Returns:
thisbuilder for chained invocation
-
release
Initializes the optional valuereleaseto release.- Parameters:
release- The value for release- Returns:
thisbuilder for use in a chained invocation
-
dc
Initializes the optional valuedcto dc.- Parameters:
dc- The value for dc- Returns:
thisbuilder for chained invocation
-
dc
Initializes the optional valuedcto dc.- Parameters:
dc- The value for dc- 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
-
build
Builds a newImmutablePutOptions.- Returns:
- An immutable instance of PutOptions
- Throws:
IllegalStateException- if any required attributes are missing
-