Interface MessageWriter.OptionBuilder
- Enclosing interface:
MessageWriter
public static sealed interface MessageWriter.OptionBuilder
A builder of message writer options.
-
Method Summary
Modifier and TypeMethodDescriptionallocator(BufferAllocator allocator) Sets the buffer allocator to be used by the message writer.identifierEncoder(MessageEncoder<? super String> encoder) Sets the string encoder to be used byMessageWriter.writeIdentifier(java.lang.String).stringEncoder(MessageEncoder<CharSequence> encoder) Sets the string encoder to be used byMessageWriter.write(CharSequence).writeBufferCapacity(int capacity) Sets the capacity of the message writer's write buffer.
-
Method Details
-
allocator
Sets the buffer allocator to be used by the message writer.
Default:
BufferAllocator.ofUnpooled()- Parameters:
allocator- the buffer allocator to be used by the message writer- Returns:
- this builder
-
writeBufferCapacity
Sets the capacity of the message writer's write buffer.
Default:
1024 * 8- Parameters:
capacity- the capacity of the message writer's write buffer- Returns:
- this builder`
-
stringEncoder
Sets the string encoder to be used by
MessageWriter.write(CharSequence).Default:
MessageEncoder.ofString()- Parameters:
encoder- the string encoder to be used byMessageWriter.write(CharSequence)- Returns:
- this builder
-
identifierEncoder
Sets the string encoder to be used by
MessageWriter.writeIdentifier(java.lang.String).Default:
MessageEncoder.ofString()- Parameters:
encoder- the string encoder to be used byMessageWriter.writeIdentifier(java.lang.String)- Returns:
- this builder
-