- All Implemented Interfaces:
Converter<ByteBuf,
,Object> Decoder<ByteBuf,
,Object> Encoder<Object,
,ByteBuf> JoinableEncoder<Object,
,ByteBuf> ReactiveConverter<ByteBuf,
,Object> ReactiveDecoder<ByteBuf,
,Object> ReactiveEncoder<Object,
,ByteBuf> SplittableDecoder<ByteBuf,
Object>
JSON Bytebuf to Object converter backed by an ObjectMapper
.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Constructor Summary
ConstructorDescriptionJacksonByteBufConverter
(com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a JSON ByteBuf converter. -
Method Summary
Modifier and TypeMethodDescription<T> T
Decodes the specified value to an object whose type is represented by the specified class.<T> T
Decodes the specified value to an object of the specified type.<T> Flux
<T> decodeMany
(Publisher<ByteBuf> value, Class<T> type) Decodes the specified stream of values whose type is represented by the specified class into a flux stream of values.<T> Flux
<T> decodeMany
(Publisher<ByteBuf> value, Type type) Decodes the specified stream of values whose type is the specified type into a flux stream of values.<T> Mono
<T> Decodes the specified stream of values whose type is represented by the specified class into a mono stream of values.<T> Mono
<T> Decodes the specified stream of values whose type is the specified type into a mono stream of value.<T> T[]
decodeToArray
(ByteBuf value, Class<T> type) Decodes the specified value whose type is represented by the specified class to an array of decoded values.<T> T[]
decodeToArray
(ByteBuf value, Type type) Decodes the specified value whose type is the specified type to an array of decoded values.<T> List
<T> decodeToList
(ByteBuf value, Class<T> type) Decodes the specified value whose type is represented by the specified class to a list of decoded values.<T> List
<T> decodeToList
(ByteBuf value, Type type) Decodes the specified value whose type is the specified type to a list of decoded values.<T> Set
<T> decodeToSet
(ByteBuf value, Class<T> type) Decodes the specified value whose type is represented by the specified class to a set of decoded values.<T> Set
<T> decodeToSet
(ByteBuf value, Type type) Decodes the specified value whose type is the specified type to a set of decoded values.Encodes the specified value to the encoded type.<T> ByteBuf
Encodes the specified value whose type is represented by the specified class to the encoded type.<T> ByteBuf
Encodes the specified value whose type is the specified type to the encoded type.<T> ByteBuf
encodeArray
(T[] value) Encodes the specified array of values to the encoded type.<T> ByteBuf
encodeArray
(T[] value, Class<T> type) Encodes the specified array of values whose type is represented by the specified class to the encoded type.<T> ByteBuf
encodeArray
(T[] value, Type type) Encodes the specified array of values whose type is represented by the specified class to the encoded type.<T> ByteBuf
encodeList
(List<T> value) Encodes the specified list of values to an encoded value.<T> ByteBuf
encodeList
(List<T> value, Class<T> type) Encodes the specified list of values whose type is represented by the specified class to an encoded value.<T> ByteBuf
encodeList
(List<T> value, Type type) Encodes the specified list of values whose type is the specified type to an encoded value.encodeMany
(Flux<T> value) Encodes a flux stream of values to a stream of values.encodeMany
(Flux<T> value, Class<T> type) Encodes a flux stream of values whose type is represented by the specified class to a stream of values.encodeMany
(Flux<T> value, Type type) Encodes a flux stream of values whose type is the specified type to a stream of values.Encodes a mono stream of values to a stream of values.Encodes a mono stream of values whose type is represented by the specified class to a stream of values.Encodes a mono stream of values whose type is the specified type to a stream of values.<T> ByteBuf
Encodes the specified set of values to an encoded value.<T> ByteBuf
Encodes the specified set of values whose type is represented by the specified class to an encoded value.<T> ByteBuf
Encodes the specified set of values whose type is the specified type to an encoded value.
-
Constructor Details
-
JacksonByteBufConverter
public JacksonByteBufConverter(com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a JSON ByteBuf converter.
- Parameters:
mapper
- a Jackson object mapper
-
-
Method Details
-
encodeOne
Description copied from interface:ReactiveEncoder
Encodes a mono stream of values to a stream of values.
- Specified by:
encodeOne
in interfaceReactiveEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the mono stream of values to encode- Returns:
- a stream of encoded values
-
encodeOne
Description copied from interface:ReactiveEncoder
Encodes a mono stream of values whose type is represented by the specified class to a stream of values.
- Specified by:
encodeOne
in interfaceReactiveEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the mono stream of values to encodetype
- the class of the decoded object- Returns:
- a stream of encoded values
-
encodeOne
Description copied from interface:ReactiveEncoder
Encodes a mono stream of values whose type is the specified type to a stream of values.
- Specified by:
encodeOne
in interfaceReactiveEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the mono stream of values to encodetype
- the type of the decoded object- Returns:
- a stream of encoded values
-
encodeMany
Description copied from interface:ReactiveEncoder
Encodes a flux stream of values to a stream of values.
- Specified by:
encodeMany
in interfaceReactiveEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the flux stream of values to encode- Returns:
- a stream of encoded values
-
encodeMany
Description copied from interface:ReactiveEncoder
Encodes a flux stream of values whose type is represented by the specified class to a stream of values.
- Specified by:
encodeMany
in interfaceReactiveEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the flux stream of values to encodetype
- the class of the decoded object- Returns:
- a stream of encoded values
-
encodeMany
Description copied from interface:ReactiveEncoder
Encodes a flux stream of values whose type is the specified type to a stream of values.
- Specified by:
encodeMany
in interfaceReactiveEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the flux stream of values to encodetype
- the type of the decoded object- Returns:
- a stream of encoded values
-
encode
Description copied from interface:Encoder
Encodes the specified value to the encoded type.
-
encode
Description copied from interface:Encoder
Encodes the specified value whose type is represented by the specified class to the encoded type.
- Specified by:
encode
in interfaceEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the object to encodetype
- the class of the decoded object- Returns:
- an encoded object
- Throws:
ConverterException
- if there was an error encoding the value
-
encode
Description copied from interface:Encoder
Encodes the specified value whose type is the specified type to the encoded type.
- Specified by:
encode
in interfaceEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the object to encodetype
- the type of the decoded object- Returns:
- an encoded object
- Throws:
ConverterException
- if there was an error encoding the value
-
encodeList
Description copied from interface:JoinableEncoder
Encodes the specified list of values to an encoded value.
- Specified by:
encodeList
in interfaceJoinableEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the list of objects to encode- Returns:
- an encoded value
-
encodeList
Description copied from interface:JoinableEncoder
Encodes the specified list of values whose type is represented by the specified class to an encoded value.
- Specified by:
encodeList
in interfaceJoinableEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the list of objects to encodetype
- the class of the decoded object- Returns:
- an encoded value
-
encodeList
Description copied from interface:JoinableEncoder
Encodes the specified list of values whose type is the specified type to an encoded value.
- Specified by:
encodeList
in interfaceJoinableEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the list of objects to encodetype
- the type of the decoded object- Returns:
- an encoded value
-
encodeSet
Description copied from interface:JoinableEncoder
Encodes the specified set of values to an encoded value.
- Specified by:
encodeSet
in interfaceJoinableEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the set of objects to encode- Returns:
- an encoded value
-
encodeSet
Description copied from interface:JoinableEncoder
Encodes the specified set of values whose type is represented by the specified class to an encoded value.
- Specified by:
encodeSet
in interfaceJoinableEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the set of objects to encodetype
- the class of the decoded object- Returns:
- an encoded value
-
encodeSet
Description copied from interface:JoinableEncoder
Encodes the specified set of values whose type is the specified type to an encoded value.
- Specified by:
encodeSet
in interfaceJoinableEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the set of objects to encodetype
- the type of the decoded object- Returns:
- an encoded value
-
encodeArray
Description copied from interface:JoinableEncoder
Encodes the specified array of values to the encoded type.
- Specified by:
encodeArray
in interfaceJoinableEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the array of objects to encode- Returns:
- an encoded value
-
encodeArray
Description copied from interface:JoinableEncoder
Encodes the specified array of values whose type is represented by the specified class to the encoded type.
- Specified by:
encodeArray
in interfaceJoinableEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the array of objects to encodetype
- the class of the decoded object- Returns:
- an encoded value
-
encodeArray
Description copied from interface:JoinableEncoder
Encodes the specified array of values whose type is represented by the specified class to the encoded type.
- Specified by:
encodeArray
in interfaceJoinableEncoder<Object,
ByteBuf> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the array of objects to encodetype
- the class of the decoded object- Returns:
- an encoded value
-
decodeOne
Description copied from interface:ReactiveDecoder
Decodes the specified stream of values whose type is represented by the specified class into a mono stream of values.
- Specified by:
decodeOne
in interfaceReactiveDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the stream of values to decodetype
- the class of the decoded object- Returns:
- a mono emitting the decoded value
-
decodeOne
Description copied from interface:ReactiveDecoder
Decodes the specified stream of values whose type is the specified type into a mono stream of value.
- Specified by:
decodeOne
in interfaceReactiveDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the stream of values to decodetype
- the type of the decoded object- Returns:
- a mono emitting the decoded value
-
decodeMany
Description copied from interface:ReactiveDecoder
Decodes the specified stream of values whose type is represented by the specified class into a flux stream of values.
- Specified by:
decodeMany
in interfaceReactiveDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the stream of values to decodetype
- the class of the decoded object- Returns:
- a flux emitting the decoded values
-
decodeMany
Description copied from interface:ReactiveDecoder
Decodes the specified stream of values whose type is the specified type into a flux stream of values.
- Specified by:
decodeMany
in interfaceReactiveDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the stream of values to decodetype
- the type of the decoded object- Returns:
- a flux emitting the decoded values
-
decode
Description copied from interface:Decoder
Decodes the specified value to an object whose type is represented by the specified class.
-
decode
Description copied from interface:Decoder
Decodes the specified value to an object of the specified type.
- Specified by:
decode
in interfaceDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the object to decodetype
- the type of the decoded object- Returns:
- a decoded object
- Throws:
ConverterException
- if there was an error decoding the value
-
decodeToList
Description copied from interface:SplittableDecoder
Decodes the specified value whose type is represented by the specified class to a list of decoded values.
- Specified by:
decodeToList
in interfaceSplittableDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the value to decodetype
- the class of the decoded object- Returns:
- a list of decoded values
-
decodeToList
Description copied from interface:SplittableDecoder
Decodes the specified value whose type is the specified type to a list of decoded values.
- Specified by:
decodeToList
in interfaceSplittableDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the value to decodetype
- the type of the decoded object- Returns:
- a list of decoded values
-
decodeToSet
Description copied from interface:SplittableDecoder
Decodes the specified value whose type is represented by the specified class to a set of decoded values.
- Specified by:
decodeToSet
in interfaceSplittableDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the value to decodetype
- the class of the decoded object- Returns:
- a set of decoded values
-
decodeToSet
Description copied from interface:SplittableDecoder
Decodes the specified value whose type is the specified type to a set of decoded values.
- Specified by:
decodeToSet
in interfaceSplittableDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the value to decodetype
- the type of the decoded object- Returns:
- a set of decoded values
-
decodeToArray
Description copied from interface:SplittableDecoder
Decodes the specified value whose type is represented by the specified class to an array of decoded values.
- Specified by:
decodeToArray
in interfaceSplittableDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the value to decodetype
- the class of the decoded object- Returns:
- an array of decoded values
-
decodeToArray
Description copied from interface:SplittableDecoder
Decodes the specified value whose type is the specified type to an array of decoded values.
- Specified by:
decodeToArray
in interfaceSplittableDecoder<ByteBuf,
Object> - Type Parameters:
T
- the type of the decoded object- Parameters:
value
- the value to decodetype
- the type of the decoded object- Returns:
- an array of decoded values
-