Package io.servicetalk.encoding.api
Class BufferDecoderGroupBuilder
java.lang.Object
io.servicetalk.encoding.api.BufferDecoderGroupBuilder
Builder for
BufferDecoderGroup
s.-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance.BufferDecoderGroupBuilder
(int decodersSizeEstimate) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionadd
(BufferDecoder decoder) Add a newBufferDecoder
to theBufferDecoderGroup
built by this builder.add
(BufferDecoder decoder, boolean advertised) Add a newBufferDecoder
to theBufferDecoderGroup
built 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 manyBufferDecoder
will be included in theBufferDecoderGroup
built by this builder.
-
-
Method Details
-
add
Add a newBufferDecoder
to theBufferDecoderGroup
built by this builder.- Parameters:
decoder
- The decoder to add.- Returns:
this
.
-
add
Add a newBufferDecoder
to theBufferDecoderGroup
built 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 ofidentity
decoders 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
.
-