Package org.kiwiproject.consul.option
Class ImmutableQueryParameterOptions.Builder
java.lang.Object
org.kiwiproject.consul.option.ImmutableQueryParameterOptions.Builder
- Enclosing class:
- ImmutableQueryParameterOptions
Builds instances of type
ImmutableQueryParameterOptions.
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 newImmutableQueryParameterOptions.from(ParamAdder instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.ParamAdderinstance.from(QueryParameterOptions instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.QueryParameterOptionsinstance.prune(boolean prune) Initializes the optional valuepruneto prune.Initializes the optional valuepruneto prune.putAllToHeaders(Map<String, ? extends String> entries) Put all mappings from the specified map as entries totoHeadersmap.putAllToQuery(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries totoQuerymap.putToHeaders(String key, String value) Put one entry to thetoHeadersmap.putToHeaders(Map.Entry<String, ? extends String> entry) Put one entry to thetoHeadersmap.putToQuery(String key, Object value) Put one entry to thetoQuerymap.putToQuery(Map.Entry<String, ? extends Object> entry) Put one entry to thetoQuerymap.replaceExistingChecks(boolean replaceExistingChecks) Initializes the optional valuereplaceExistingChecksto replaceExistingChecks.replaceExistingChecks(Optional<Boolean> replaceExistingChecks) Initializes the optional valuereplaceExistingChecksto replaceExistingChecks.Sets or replaces all mappings from the specified map as entries for thetoHeadersmap.Sets or replaces all mappings from the specified map as entries for thetoQuerymap.
-
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 ImmutableQueryParameterOptions.Builder from(QueryParameterOptions instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.QueryParameterOptionsinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
putToQuery
@CanIgnoreReturnValue public final ImmutableQueryParameterOptions.Builder putToQuery(String key, Object value) Put one entry to thetoQuerymap.- Parameters:
key- The key in the toQuery mapvalue- The associated value in the toQuery map- Returns:
thisbuilder for use in a chained invocation
-
putToQuery
@CanIgnoreReturnValue public final ImmutableQueryParameterOptions.Builder putToQuery(Map.Entry<String, ? extends Object> entry) Put one entry to thetoQuerymap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
toQuery
@CanIgnoreReturnValue public final ImmutableQueryParameterOptions.Builder toQuery(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thetoQuerymap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the toQuery map- Returns:
thisbuilder for use in a chained invocation
-
putAllToQuery
@CanIgnoreReturnValue public final ImmutableQueryParameterOptions.Builder putAllToQuery(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries totoQuerymap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the toQuery map- Returns:
thisbuilder for use in a chained invocation
-
putToHeaders
@CanIgnoreReturnValue public final ImmutableQueryParameterOptions.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 ImmutableQueryParameterOptions.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 ImmutableQueryParameterOptions.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 ImmutableQueryParameterOptions.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
-
replaceExistingChecks
@CanIgnoreReturnValue public final ImmutableQueryParameterOptions.Builder replaceExistingChecks(boolean replaceExistingChecks) Initializes the optional valuereplaceExistingChecksto replaceExistingChecks.- Parameters:
replaceExistingChecks- The value for replaceExistingChecks- Returns:
thisbuilder for chained invocation
-
replaceExistingChecks
@CanIgnoreReturnValue public final ImmutableQueryParameterOptions.Builder replaceExistingChecks(Optional<Boolean> replaceExistingChecks) Initializes the optional valuereplaceExistingChecksto replaceExistingChecks.- Parameters:
replaceExistingChecks- The value for replaceExistingChecks- Returns:
thisbuilder for use in a chained invocation
-
prune
Initializes the optional valuepruneto prune.- Parameters:
prune- The value for prune- Returns:
thisbuilder for chained invocation
-
prune
@CanIgnoreReturnValue public final ImmutableQueryParameterOptions.Builder prune(Optional<Boolean> prune) Initializes the optional valuepruneto prune.- Parameters:
prune- The value for prune- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableQueryParameterOptions.- Returns:
- An immutable instance of QueryParameterOptions
- Throws:
IllegalStateException- if any required attributes are missing
-