IN
- The type to decode JSON intoOUT
- The type to encode into JSONpublic class JsonCodec<IN,OUT> extends BufferCodec<IN,OUT>
DEFAULT_DELIMITER, delimiter
Constructor and Description |
---|
JsonCodec(Class<IN> inputType)
Creates a new
JsonCodec that will create instances of inputType when
decoding. |
JsonCodec(Class<IN> inputType,
com.fasterxml.jackson.databind.Module customModule)
Creates a new
JsonCodec that will create instances of inputType when
decoding. |
JsonCodec(Class<IN> inputType,
com.fasterxml.jackson.databind.Module customModule,
Byte delimiter)
Creates a new
JsonCodec that will create instances of inputType when
decoding. |
Modifier and Type | Method and Description |
---|---|
Buffer |
apply(OUT out)
Execute the logic of the action, accepting the given parameter.
|
Function<Buffer,IN> |
decoder(Consumer<IN> next)
Provide the caller with a decoder to turn a source object into an instance of the input
type.
|
protected IN |
doBufferDecode(Buffer buffer)
Decode a buffer
|
decode, encode
addDelimiterIfAny, decoder, doDelimitedBufferDecode, encoder, invokeCallbackOrReturn
public JsonCodec(Class<IN> inputType)
JsonCodec
that will create instances of inputType
when
decoding.inputType
- The type to create when decoding.public JsonCodec(Class<IN> inputType, com.fasterxml.jackson.databind.Module customModule)
JsonCodec
that will create instances of inputType
when
decoding. The customModule
will be registered with the underlying ObjectMapper
.inputType
- The type to create when decoding.customModule
- The module to register with the underlying ObjectMapperpublic JsonCodec(Class<IN> inputType, com.fasterxml.jackson.databind.Module customModule, Byte delimiter)
JsonCodec
that will create instances of inputType
when
decoding. The customModule
will be registered with the underlying ObjectMapper
.inputType
- The type to create when decoding.customModule
- The module to register with the underlying ObjectMapperdelimiter
- A nullable delimiting byte for batch decodingprotected IN doBufferDecode(Buffer buffer)
Codec
doBufferDecode
in class Codec<Buffer,IN,OUT>
public Function<Buffer,IN> decoder(Consumer<IN> next)
Codec
Copyright © 2016. All rights reserved.