Class MessageConfig.BuilderBase<T, BUILDER extends MessageConfig.BuilderBase<T, BUILDER, PROTOTYPE>, PROTOTYPE extends MessageConfig<T>>
java.lang.Object
io.helidon.messaging.MessageConfig.BuilderBase<T, BUILDER, PROTOTYPE>
- Type Parameters:
T- payload typeBUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER, PROTOTYPE>
- Direct Known Subclasses:
MessageConfig.Builder
- Enclosing interface:
MessageConfig<T>
public abstract static class MessageConfig.BuilderBase<T, BUILDER extends MessageConfig.BuilderBase<T, BUILDER, PROTOTYPE>, PROTOTYPE extends MessageConfig<T>>
extends Object
implements Prototype.Builder<BUILDER, PROTOTYPE>
Fluent API builder base for
MessageConfig.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHeader(MessageHeader header) Ordered portable headers.addHeader(String name, MessageHeaderValue value) Append a portable typed header, retaining values with the same exact name.Append a portable text header, retaining values with the same exact name.addHeaders(List<? extends MessageHeader> headers) Ordered portable headers.addLocalMetadata(Map<String, ? extends MessageHeaderValue> localMetadata) Metadata local to this message envelope.protected final MessageConfig<T> buildPrototype(MessageConfig.BuilderBase<T, ?, ?> builder) Create a new prototype instance from a builder.Clear all headers.entity()Non-null message payload.Non-null message payload.from(MessageConfig.BuilderBase<T, ?, ?> builder) Update this builder from an existing prototype builder instance.from(MessageConfig<T> prototype) Update this builder from an existing prototype instance.header(String name, MessageHeaderValue value) Set a portable typed header, replacing all values with the same exact name.Set a portable text header, replacing all values with the same exact name.headers()Ordered portable headers.headers(MessageHeaders headers) Replace all portable headers with the supplied immutable snapshot.headers(Consumer<MessageHeaders.Builder> consumer) Replace all portable headers using an initially empty headers builder.headers(Supplier<? extends MessageHeaders> supplier) Replace all portable headers using a supplier evaluated immediately.headers(List<? extends MessageHeader> headers) Ordered portable headers.Metadata local to this message envelope.localMetadata(MessageMetadata localMetadata) Replace all local metadata with the supplied immutable snapshot.localMetadata(String key, MessageHeaderValue localMetadata) Metadata local to this message envelope.localMetadata(String name, String value) Set a local text metadata value, replacing the value with the same exact name.localMetadata(Consumer<MessageMetadata.Builder> consumer) Replace all local metadata using an initially empty metadata builder.localMetadata(Supplier<? extends MessageMetadata> supplier) Replace all local metadata using a supplier evaluated immediately.localMetadata(Map<String, ? extends MessageHeaderValue> localMetadata) Metadata local to this message envelope.protected voidHandles providers and decorators.toString()protected voidValidates required properties.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
header
Set a portable text header, replacing all values with the same exact name.- Parameters:
name- header namevalue- header value- Returns:
- updated builder instance
- Throws:
NullPointerException- ifnameorvalueisnull
-
header
Set a portable typed header, replacing all values with the same exact name.- Parameters:
name- header namevalue- header value- Returns:
- updated builder instance
- Throws:
NullPointerException- ifnameorvalueisnull
-
addHeader
Append a portable text header, retaining values with the same exact name.- Parameters:
name- header namevalue- header value- Returns:
- updated builder instance
- Throws:
NullPointerException- ifnameorvalueisnull
-
addHeader
Append a portable typed header, retaining values with the same exact name.- Parameters:
name- header namevalue- header value- Returns:
- updated builder instance
- Throws:
NullPointerException- ifnameorvalueisnull
-
headers
Replace all portable headers with the supplied immutable snapshot.- Parameters:
headers- portable headers- Returns:
- updated builder instance
- Throws:
NullPointerException- ifheadersisnull
-
headers
Replace all portable headers using an initially empty headers builder.- Parameters:
consumer- headers builder consumer- Returns:
- updated builder instance
- Throws:
NullPointerException- ifconsumerisnull
-
headers
Replace all portable headers using a supplier evaluated immediately.- Parameters:
supplier- portable headers supplier- Returns:
- updated builder instance
- Throws:
NullPointerException- ifsupplieror its result isnull
-
localMetadata
Set a local text metadata value, replacing the value with the same exact name.- Parameters:
name- exact metadata namevalue- text value- Returns:
- updated builder instance
- Throws:
NullPointerException- ifnameorvalueisnull
-
localMetadata
Replace all local metadata with the supplied immutable snapshot.- Parameters:
localMetadata- local metadata- Returns:
- updated builder instance
- Throws:
NullPointerException- iflocalMetadataisnull
-
localMetadata
Replace all local metadata using an initially empty metadata builder.- Parameters:
consumer- metadata builder consumer- Returns:
- updated builder instance
- Throws:
NullPointerException- ifconsumerisnull
-
localMetadata
Replace all local metadata using a supplier evaluated immediately.- Parameters:
supplier- local metadata supplier- Returns:
- updated builder instance
- Throws:
NullPointerException- ifsupplieror its result isnull
-
entity
-
clearHeaders
-
headers
Ordered portable headers. Defaults to an empty list. Setting this option replaces the current entries; adding headers preserves their order and duplicate names. The builder accumulates entries in a mutable list and the prototype contains an immutable snapshot.- Parameters:
headers- portable headers- Returns:
- updated builder instance
- See Also:
-
addHeaders
Ordered portable headers. Defaults to an empty list. Setting this option replaces the current entries; adding headers preserves their order and duplicate names. The builder accumulates entries in a mutable list and the prototype contains an immutable snapshot.- Parameters:
headers- portable headers- Returns:
- updated builder instance
- See Also:
-
addHeader
Ordered portable headers. Defaults to an empty list. Setting this option replaces the current entries; adding headers preserves their order and duplicate names. The builder accumulates entries in a mutable list and the prototype contains an immutable snapshot.- Parameters:
header- add single portable headers- Returns:
- updated builder instance
- See Also:
-
localMetadata
Metadata local to this message envelope. Defaults to an empty map. Setting this option replaces the current entries; adding a value replaces the value with the same exact name. The builder accumulates entries in a mutable map and the prototype contains an immutable snapshot. Local metadata remains in-process and is not part of portable headers or generic connector mapping. This method replaces all values with the new ones.- Parameters:
localMetadata- local metadata- Returns:
- updated builder instance
- See Also:
-
addLocalMetadata
Metadata local to this message envelope. Defaults to an empty map. Setting this option replaces the current entries; adding a value replaces the value with the same exact name. The builder accumulates entries in a mutable map and the prototype contains an immutable snapshot. Local metadata remains in-process and is not part of portable headers or generic connector mapping. This method keeps existing values, then puts all new values into the map.- Parameters:
localMetadata- local metadata- Returns:
- updated builder instance
- See Also:
-
localMetadata
Metadata local to this message envelope. Defaults to an empty map. Setting this option replaces the current entries; adding a value replaces the value with the same exact name. The builder accumulates entries in a mutable map and the prototype contains an immutable snapshot. Local metadata remains in-process and is not part of portable headers or generic connector mapping. This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key- key to add or replacelocalMetadata- new value for the key- Returns:
- updated builder instance
- See Also:
-
entity
-
headers
Ordered portable headers. Defaults to an empty list. Setting this option replaces the current entries; adding headers preserves their order and duplicate names. The builder accumulates entries in a mutable list and the prototype contains an immutable snapshot.- Returns:
- portable headers
-
localMetadata
Metadata local to this message envelope. Defaults to an empty map. Setting this option replaces the current entries; adding a value replaces the value with the same exact name. The builder accumulates entries in a mutable map and the prototype contains an immutable snapshot. Local metadata remains in-process and is not part of portable headers or generic connector mapping.- Returns:
- local metadata
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties. -
buildPrototype
Create a new prototype instance from a builder.- Parameters:
builder- builder used to create the prototype- Returns:
- new prototype instance
-