Class JsonByteBufMediaTypeConverter
- All Implemented Interfaces:
Converter<ByteBuf,
,Object> Decoder<ByteBuf,
,Object> Encoder<Object,
,ByteBuf> MediaTypeConverter<ByteBuf>
,ReactiveConverter<ByteBuf,
,Object> ReactiveDecoder<ByteBuf,
,Object> ReactiveEncoder<Object,
ByteBuf>
ByteBuf application/json
media type converter.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Constructor Summary
ConstructorDescriptionJsonByteBufMediaTypeConverter
(ReactiveConverter<ByteBuf, Object> jsonByteBufConverter) Create anapplication/json
media type converter. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canConvert
(String mediaType) Determines whether the converter can convert the specified media type.<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> ByteBuf
encode
(T value) 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.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.base.converter.ReactiveDecoder
decodeMany, decodeMany, decodeOne, decodeOne
Methods inherited from interface io.inverno.mod.base.converter.ReactiveEncoder
encodeOne, encodeOne, encodeOne
-
Constructor Details
-
JsonByteBufMediaTypeConverter
Create an
application/json
media type converter.- Parameters:
jsonByteBufConverter
- the underlying JSON ByteBuf converter
-
-
Method Details
-
canConvert
Description copied from interface:MediaTypeConverter
Determines whether the converter can convert the specified media type.
- Specified by:
canConvert
in interfaceMediaTypeConverter<ByteBuf>
- Parameters:
mediaType
- a media type- Returns:
- true if the converter can convert the media type, false otherwise
-
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
-
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
-
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
-
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
-