- All Implemented Interfaces:
Converter<String,,Object> Decoder<String,,Object> Encoder<Object,,String> JoinableEncoder<Object,,String> ReactiveConverter<String,,Object> ReactiveDecoder<String,,Object> ReactiveEncoder<Object,,String> SplittableDecoder<String,Object>
JSON String to Object converter backed by an ObjectMapper.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJacksonStringConverter(com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a JSON String converter. -
Method Summary
Modifier and TypeMethodDescription<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> T[]decodeToArray(String 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(String value, Type type) Decodes the specified value whose type is the specified type to an array of decoded values.<T> List<T> decodeToList(String 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(String value, Type type) Decodes the specified value whose type is the specified type to a list of decoded values.<T> Set<T> decodeToSet(String 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(String value, Type type) Decodes the specified value whose type is the specified type to a set of decoded values.<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.<T> StringencodeArray(T[] value) Encodes the specified array of values to the encoded type.<T> StringencodeArray(T[] value, Class<T> type) Encodes the specified array of values whose type is represented by the specified class to the encoded type.<T> StringencodeArray(T[] value, Type type) Encodes the specified array of values whose type is represented by the specified class to the encoded type.<T> StringencodeList(List<T> value) Encodes the specified list of values to an encoded value.<T> StringencodeList(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> StringencodeList(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> StringEncodes the specified set of values to an encoded value.<T> StringEncodes the specified set of values whose type is represented by the specified class to an encoded value.<T> StringEncodes the specified set of values whose type is the specified type to an encoded value.
-
Constructor Details
-
JacksonStringConverter
public JacksonStringConverter(com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a JSON String converter.
- Parameters:
mapper- a Jackson object mapper
-
-
Method Details
-
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
-
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
-
encodeList
Description copied from interface:JoinableEncoderEncodes the specified list of values to an encoded value.
- Specified by:
encodeListin interfaceJoinableEncoder<Object,String> - Type Parameters:
T- the type of the decoded object- Parameters:
value- the list of objects to encode- Returns:
- an encoded value
- Throws:
ConverterException- if there was an error encoding the value
-
encodeList
Description copied from interface:JoinableEncoderEncodes the specified list of values whose type is represented by the specified class to an encoded value.
- Specified by:
encodeListin interfaceJoinableEncoder<Object,String> - 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
- Throws:
ConverterException- if there was an error encoding the value
-
encodeList
Description copied from interface:JoinableEncoderEncodes the specified list of values whose type is the specified type to an encoded value.
- Specified by:
encodeListin interfaceJoinableEncoder<Object,String> - 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
- Throws:
ConverterException- if there was an error encoding the value
-
encodeSet
Description copied from interface:JoinableEncoderEncodes the specified set of values to an encoded value.
- Specified by:
encodeSetin interfaceJoinableEncoder<Object,String> - Type Parameters:
T- the type of the decoded object- Parameters:
value- the set of objects to encode- Returns:
- an encoded value
- Throws:
ConverterException- if there was an error encoding the value
-
encodeSet
Description copied from interface:JoinableEncoderEncodes the specified set of values whose type is represented by the specified class to an encoded value.
- Specified by:
encodeSetin interfaceJoinableEncoder<Object,String> - 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
- Throws:
ConverterException- if there was an error encoding the value
-
encodeSet
Description copied from interface:JoinableEncoderEncodes the specified set of values whose type is the specified type to an encoded value.
- Specified by:
encodeSetin interfaceJoinableEncoder<Object,String> - 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
- Throws:
ConverterException- if there was an error encoding the value
-
encodeArray
Description copied from interface:JoinableEncoderEncodes the specified array of values to the encoded type.
- Specified by:
encodeArrayin interfaceJoinableEncoder<Object,String> - Type Parameters:
T- the type of the decoded object- Parameters:
value- the array of objects to encode- Returns:
- an encoded value
- Throws:
ConverterException- if there was an error encoding the value
-
encodeArray
Description copied from interface:JoinableEncoderEncodes the specified array of values whose type is represented by the specified class to the encoded type.
- Specified by:
encodeArrayin interfaceJoinableEncoder<Object,String> - 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
- Throws:
ConverterException- if there was an error encoding the value
-
encodeArray
Description copied from interface:JoinableEncoderEncodes the specified array of values whose type is represented by the specified class to the encoded type.
- Specified by:
encodeArrayin interfaceJoinableEncoder<Object,String> - 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
- 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
-
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
-
decodeToList
Description copied from interface:SplittableDecoderDecodes the specified value whose type is represented by the specified class to a list of decoded values.
- Specified by:
decodeToListin interfaceSplittableDecoder<String,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:SplittableDecoderDecodes the specified value whose type is the specified type to a list of decoded values.
- Specified by:
decodeToListin interfaceSplittableDecoder<String,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:SplittableDecoderDecodes the specified value whose type is represented by the specified class to a set of decoded values.
- Specified by:
decodeToSetin interfaceSplittableDecoder<String,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:SplittableDecoderDecodes the specified value whose type is the specified type to a set of decoded values.
- Specified by:
decodeToSetin interfaceSplittableDecoder<String,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:SplittableDecoderDecodes the specified value whose type is represented by the specified class to an array of decoded values.
- Specified by:
decodeToArrayin interfaceSplittableDecoder<String,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:SplittableDecoderDecodes the specified value whose type is the specified type to an array of decoded values.
- Specified by:
decodeToArrayin interfaceSplittableDecoder<String,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
-