Package org.kiwiproject.consul.option
Class ImmutableTokenQueryOptions.Builder
java.lang.Object
org.kiwiproject.consul.option.ImmutableTokenQueryOptions.Builder
- Enclosing class:
- ImmutableTokenQueryOptions
Builds instances of type
ImmutableTokenQueryOptions.
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.authMethod(String authMethod) Initializes the optional valueauthMethodto authMethod.authMethod(Optional<String> authMethod) Initializes the optional valueauthMethodto authMethod.authMethodNamespace(String authMethodNamespace) Initializes the optional valueauthMethodNamespaceto authMethodNamespace.authMethodNamespace(Optional<String> authMethodNamespace) Initializes the optional valueauthMethodNamespaceto authMethodNamespace.build()Builds a newImmutableTokenQueryOptions.from(ParamAdder instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.ParamAdderinstance.from(TokenQueryOptions instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.TokenQueryOptionsinstance.Initializes the optional valuenamespaceto namespace.Initializes the optional valuenamespaceto namespace.Initializes the optional valuepolicyto policy.Initializes the optional valuepolicyto policy.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 valueroleto role.Initializes the optional valueroleto role.Sets or replaces all mappings from the specified map as entries for thetoHeadersmap.toQueryParameters(Iterable<String> elements) Sets or replaces all elements fortoQueryParameterslist.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableTokenQueryOptions.Builder from(TokenQueryOptions instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.TokenQueryOptionsinstance.- 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.ParamAdderinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
addToQueryParameters
@CanIgnoreReturnValue public final ImmutableTokenQueryOptions.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 ImmutableTokenQueryOptions.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 ImmutableTokenQueryOptions.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 ImmutableTokenQueryOptions.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 ImmutableTokenQueryOptions.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 ImmutableTokenQueryOptions.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 ImmutableTokenQueryOptions.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 ImmutableTokenQueryOptions.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
-
policy
Initializes the optional valuepolicyto policy.- Parameters:
policy- The value for policy- Returns:
thisbuilder for chained invocation
-
policy
@CanIgnoreReturnValue public final ImmutableTokenQueryOptions.Builder policy(Optional<String> policy) Initializes the optional valuepolicyto policy.- Parameters:
policy- The value for policy- Returns:
thisbuilder for use in a chained invocation
-
role
Initializes the optional valueroleto role.- Parameters:
role- The value for role- Returns:
thisbuilder for chained invocation
-
role
Initializes the optional valueroleto role.- Parameters:
role- The value for role- Returns:
thisbuilder for use in a chained invocation
-
authMethod
Initializes the optional valueauthMethodto authMethod.- Parameters:
authMethod- The value for authMethod- Returns:
thisbuilder for chained invocation
-
authMethod
@CanIgnoreReturnValue public final ImmutableTokenQueryOptions.Builder authMethod(Optional<String> authMethod) Initializes the optional valueauthMethodto authMethod.- Parameters:
authMethod- The value for authMethod- Returns:
thisbuilder for use in a chained invocation
-
authMethodNamespace
@CanIgnoreReturnValue public final ImmutableTokenQueryOptions.Builder authMethodNamespace(String authMethodNamespace) Initializes the optional valueauthMethodNamespaceto authMethodNamespace.- Parameters:
authMethodNamespace- The value for authMethodNamespace- Returns:
thisbuilder for chained invocation
-
authMethodNamespace
@CanIgnoreReturnValue public final ImmutableTokenQueryOptions.Builder authMethodNamespace(Optional<String> authMethodNamespace) Initializes the optional valueauthMethodNamespaceto authMethodNamespace.- Parameters:
authMethodNamespace- The value for authMethodNamespace- 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 ImmutableTokenQueryOptions.Builder namespace(Optional<String> namespace) Initializes the optional valuenamespaceto namespace.- Parameters:
namespace- The value for namespace- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableTokenQueryOptions.- Returns:
- An immutable instance of TokenQueryOptions
- Throws:
IllegalStateException- if any required attributes are missing
-