Package io.servicetalk.encoding.api
Class BufferDecoderGroupBuilder
java.lang.Object
io.servicetalk.encoding.api.BufferDecoderGroupBuilder
Builder for
BufferDecoderGroups.-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance.BufferDecoderGroupBuilder(int decodersSizeEstimate) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionadd(BufferDecoder decoder) Add a newBufferDecoderto theBufferDecoderGroupbuilt by this builder.add(BufferDecoder decoder, boolean advertised) Add a newBufferDecoderto theBufferDecoderGroupbuilt by this builder.build()Build a newBufferDecoderGroup.
-
Constructor Details
-
BufferDecoderGroupBuilder
public BufferDecoderGroupBuilder()Create a new instance. -
BufferDecoderGroupBuilder
public BufferDecoderGroupBuilder(int decodersSizeEstimate) Create a new instance.- Parameters:
decodersSizeEstimate- estimate as to how manyBufferDecoderwill be included in theBufferDecoderGroupbuilt by this builder.
-
-
Method Details
-
add
Add a newBufferDecoderto theBufferDecoderGroupbuilt by this builder.- Parameters:
decoder- The decoder to add.- Returns:
this.
-
add
Add a newBufferDecoderto theBufferDecoderGroupbuilt by this builder.- Parameters:
decoder- The decoder to add.advertised-true- the decoder should be included inBufferDecoderGroup.advertisedMessageEncoding()false-the decoder is excluded fromBufferDecoderGroup.advertisedMessageEncoding()and therefore won't be included inAccept-Encoding(or equivalent) metadata headers. In this case the peer won't be explicitly be told this decoder is supported. Commonly used to discourage usage ofidentitydecoders in favor of other more preferred options, but still support it as a fallback if there are no common decoders.
- Returns:
this.
-
build
Build a newBufferDecoderGroup.- Returns:
- a new
BufferDecoderGroup.
-