Package org.kiwiproject.consul.option
Class ImmutableEventOptions.Builder
java.lang.Object
org.kiwiproject.consul.option.ImmutableEventOptions.Builder
- Enclosing class:
- ImmutableEventOptions
Builds instances of type
ImmutableEventOptions.
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 newImmutableEventOptions.datacenter(String datacenter) Initializes the optional valuedatacenterto datacenter.datacenter(Optional<String> datacenter) Initializes the optional valuedatacenterto datacenter.from(EventOptions instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.EventOptionsinstance.from(ParamAdder instance) Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.ParamAdderinstance.nodeFilter(String nodeFilter) Initializes the optional valuenodeFilterto nodeFilter.nodeFilter(Optional<String> nodeFilter) Initializes the optional valuenodeFilterto nodeFilter.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.serviceFilter(String serviceFilter) Initializes the optional valueserviceFilterto serviceFilter.serviceFilter(Optional<String> serviceFilter) Initializes the optional valueserviceFilterto serviceFilter.Initializes the optional valuetagFilterto tagFilter.Initializes the optional valuetagFilterto tagFilter.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
Fill a builder with attribute values from the providedorg.kiwiproject.consul.option.EventOptionsinstance.- 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 ImmutableEventOptions.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 ImmutableEventOptions.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 ImmutableEventOptions.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 ImmutableEventOptions.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 ImmutableEventOptions.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 ImmutableEventOptions.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 ImmutableEventOptions.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 ImmutableEventOptions.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
-
datacenter
Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableEventOptions.Builder datacenter(Optional<String> datacenter) Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for use in a chained invocation
-
nodeFilter
Initializes the optional valuenodeFilterto nodeFilter.- Parameters:
nodeFilter- The value for nodeFilter- Returns:
thisbuilder for chained invocation
-
nodeFilter
@CanIgnoreReturnValue public final ImmutableEventOptions.Builder nodeFilter(Optional<String> nodeFilter) Initializes the optional valuenodeFilterto nodeFilter.- Parameters:
nodeFilter- The value for nodeFilter- Returns:
thisbuilder for use in a chained invocation
-
serviceFilter
@CanIgnoreReturnValue public final ImmutableEventOptions.Builder serviceFilter(String serviceFilter) Initializes the optional valueserviceFilterto serviceFilter.- Parameters:
serviceFilter- The value for serviceFilter- Returns:
thisbuilder for chained invocation
-
serviceFilter
@CanIgnoreReturnValue public final ImmutableEventOptions.Builder serviceFilter(Optional<String> serviceFilter) Initializes the optional valueserviceFilterto serviceFilter.- Parameters:
serviceFilter- The value for serviceFilter- Returns:
thisbuilder for use in a chained invocation
-
tagFilter
Initializes the optional valuetagFilterto tagFilter.- Parameters:
tagFilter- The value for tagFilter- Returns:
thisbuilder for chained invocation
-
tagFilter
@CanIgnoreReturnValue public final ImmutableEventOptions.Builder tagFilter(Optional<String> tagFilter) Initializes the optional valuetagFilterto tagFilter.- Parameters:
tagFilter- The value for tagFilter- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableEventOptions.- Returns:
- An immutable instance of EventOptions
- Throws:
IllegalStateException- if any required attributes are missing
-