Class NdJsonStringMediaTypeConverter
- All Implemented Interfaces:
Converter<String,,Object> Decoder<String,,Object> Encoder<Object,,String> MediaTypeConverter<String>,ReactiveConverter<String,,Object> ReactiveDecoder<String,,Object> ReactiveEncoder<Object,String>
String application/x-ndjson media type converter as defined by Newline Delimited JSON.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNdJsonStringMediaTypeConverter(ReactiveConverter<String, Object> jsonStringConverter) Creates anapplication/x-ndjsonmedia type converter. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(String mediaType) Determines whether the converter can convert the specified media type.<T> TDecodes the specified value to an object whose type is represented by the specified class.<T> TDecodes the specified value to an object of the specified type.<T> Flux<T> decodeMany(Publisher<String> 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<String> 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> Stringencode(T value) Encodes the specified value to the encoded type.<T> StringEncodes the specified value whose type is represented by the specified class to the encoded type.<T> StringEncodes 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.
-
Constructor Details
-
NdJsonStringMediaTypeConverter
Creates an
application/x-ndjsonmedia type converter.- Parameters:
jsonStringConverter- the underlying JSON String converter
-
-
Method Details
-
canConvert
Description copied from interface:MediaTypeConverterDetermines whether the converter can convert the specified media type.
- Specified by:
canConvertin interfaceMediaTypeConverter<String>- Parameters:
mediaType- a media type- Returns:
- true if the converter can convert the media type, false otherwise
-
decode
Description copied from interface:DecoderDecodes the specified value to an object whose type is represented by the specified class.
- Specified by:
decodein interfaceDecoder<String,Object> - Type Parameters:
T- the type of the decoded object- Parameters:
value- the object to decodetype- the class of the decoded object- Returns:
- a decoded object
- Throws:
ConverterException- if there was an error decoding the value
-
decode
Description copied from interface:DecoderDecodes the specified value to an object of the specified type.
- Specified by:
decodein interfaceDecoder<String,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
-
encode
Description copied from interface:EncoderEncodes the specified value to the encoded type.
- Specified by:
encodein interfaceEncoder<Object,String> - Type Parameters:
T- the type of the decoded object- Parameters:
value- the object to encode- Returns:
- an encoded object
- Throws:
ConverterException- if there was an error encoding the value
-
encode
Description copied from interface:EncoderEncodes the specified value whose type is represented by the specified class to the encoded type.
- Specified by:
encodein interfaceEncoder<Object,String> - 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:EncoderEncodes the specified value whose type is the specified type to the encoded type.
- Specified by:
encodein interfaceEncoder<Object,String> - 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
-
decodeOne
Description copied from interface:ReactiveDecoderDecodes the specified stream of values whose type is represented by the specified class into a mono stream of values.
- Specified by:
decodeOnein interfaceReactiveDecoder<String,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:ReactiveDecoderDecodes the specified stream of values whose type is the specified type into a mono stream of value.
- Specified by:
decodeOnein interfaceReactiveDecoder<String,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:ReactiveDecoderDecodes the specified stream of values whose type is represented by the specified class into a flux stream of values.
- Specified by:
decodeManyin interfaceReactiveDecoder<String,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:ReactiveDecoderDecodes the specified stream of values whose type is the specified type into a flux stream of values.
- Specified by:
decodeManyin interfaceReactiveDecoder<String,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
-
encodeOne
Description copied from interface:ReactiveEncoderEncodes a mono stream of values to a stream of values.
- Specified by:
encodeOnein interfaceReactiveEncoder<Object,String> - 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:ReactiveEncoderEncodes a mono stream of values whose type is represented by the specified class to a stream of values.
- Specified by:
encodeOnein interfaceReactiveEncoder<Object,String> - 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:ReactiveEncoderEncodes a mono stream of values whose type is the specified type to a stream of values.
- Specified by:
encodeOnein interfaceReactiveEncoder<Object,String> - 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:ReactiveEncoderEncodes a flux stream of values to a stream of values.
- Specified by:
encodeManyin interfaceReactiveEncoder<Object,String> - 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:ReactiveEncoderEncodes a flux stream of values whose type is represented by the specified class to a stream of values.
- Specified by:
encodeManyin interfaceReactiveEncoder<Object,String> - 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:ReactiveEncoderEncodes a flux stream of values whose type is the specified type to a stream of values.
- Specified by:
encodeManyin interfaceReactiveEncoder<Object,String> - 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
-