public class TextPlainMessageSerializer extends Object implements MessageTextSerializer<Function<Object,String>>
logger
Constructor and Description |
---|
TextPlainMessageSerializer() |
Modifier and Type | Method and Description |
---|---|
RequestMessage |
deserializeRequest(io.netty.buffer.ByteBuf msg)
Deserialize a Netty
ByteBuf into a RequestMessage . |
RequestMessage |
deserializeRequest(String msg) |
ResponseMessage |
deserializeResponse(io.netty.buffer.ByteBuf msg)
Deserialize a Netty
ByteBuf into a ResponseMessage . |
ResponseMessage |
deserializeResponse(String msg) |
Function<Object,String> |
getMapper()
Gets the "mapper" that performs the underlying serialization work.
|
String[] |
mimeTypesSupported()
The list of mime types that the serializer supports.
|
io.netty.buffer.ByteBuf |
serializeRequestAsBinary(RequestMessage requestMessage,
io.netty.buffer.ByteBufAllocator allocator)
Serialize a
ResponseMessage to a Netty ByteBuf . |
String |
serializeRequestAsString(RequestMessage requestMessage,
io.netty.buffer.ByteBufAllocator allocator) |
io.netty.buffer.ByteBuf |
serializeResponseAsBinary(ResponseMessage responseMessage,
io.netty.buffer.ByteBufAllocator allocator)
Serialize a
ResponseMessage to a Netty ByteBuf . |
String |
serializeResponseAsString(ResponseMessage responseMessage,
io.netty.buffer.ByteBufAllocator allocator) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure
public Function<Object,String> getMapper()
MessageSerializer
getMapper
in interface MessageSerializer<Function<Object,String>>
public io.netty.buffer.ByteBuf serializeResponseAsBinary(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator) throws SerializationException
MessageSerializer
ResponseMessage
to a Netty ByteBuf
.serializeResponseAsBinary
in interface MessageSerializer<Function<Object,String>>
responseMessage
- The response message to serialize to bytes.allocator
- The Netty allocator for the ByteBuf
to return back.SerializationException
public io.netty.buffer.ByteBuf serializeRequestAsBinary(RequestMessage requestMessage, io.netty.buffer.ByteBufAllocator allocator) throws SerializationException
MessageSerializer
ResponseMessage
to a Netty ByteBuf
.serializeRequestAsBinary
in interface MessageSerializer<Function<Object,String>>
requestMessage
- The request message to serialize to bytes.allocator
- The Netty allocator for the ByteBuf
to return back.SerializationException
public RequestMessage deserializeRequest(io.netty.buffer.ByteBuf msg) throws SerializationException
MessageSerializer
ByteBuf
into a RequestMessage
.deserializeRequest
in interface MessageSerializer<Function<Object,String>>
SerializationException
public ResponseMessage deserializeResponse(io.netty.buffer.ByteBuf msg) throws SerializationException
MessageSerializer
ByteBuf
into a ResponseMessage
.deserializeResponse
in interface MessageSerializer<Function<Object,String>>
SerializationException
public String[] mimeTypesSupported()
MessageSerializer
mimeTypesSupported
in interface MessageSerializer<Function<Object,String>>
public String serializeResponseAsString(ResponseMessage responseMessage, io.netty.buffer.ByteBufAllocator allocator) throws SerializationException
serializeResponseAsString
in interface MessageTextSerializer<Function<Object,String>>
SerializationException
public String serializeRequestAsString(RequestMessage requestMessage, io.netty.buffer.ByteBufAllocator allocator) throws SerializationException
serializeRequestAsString
in interface MessageTextSerializer<Function<Object,String>>
SerializationException
public RequestMessage deserializeRequest(String msg) throws SerializationException
deserializeRequest
in interface MessageTextSerializer<Function<Object,String>>
SerializationException
public ResponseMessage deserializeResponse(String msg) throws SerializationException
deserializeResponse
in interface MessageTextSerializer<Function<Object,String>>
SerializationException
Copyright © 2013–2023 Apache Software Foundation. All rights reserved.