- All Implemented Interfaces:
Converter<String,
,Object> Decoder<String,
,Object> Encoder<Object,
,String> MediaTypeConverter<String>
,ReactiveConverter<String,
,Object> ReactiveDecoder<String,
,Object> ReactiveEncoder<Object,
String>
String text/plain
media type converter.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
- See Also:
-
Constructor Summary
ConstructorDescriptionTextStringMediaTypeConverter
(ObjectConverter<String> stringConverter) Creates atext/plain
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.decodeBigDecimal
(String value) decodeBigInteger
(String value) decodeBoolean
(String value) decodeByte
(String value) decodeCharacter
(String value) Class
<?> decodeClass
(String value) decodeCurrency
(String value) decodeDouble
(String value) decodeFile
(String value) decodeFloat
(String value) decodeInetAddress
(String value) decodeInteger
(String value) decodeLocalDate
(String value) decodeLocalDateTime
(String value) decodeLocale
(String value) decodeLong
(String value) <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.decodePath
(String value) decodePattern
(String value) decodeShort
(String value) decodeString
(String value) <T> T[]
decodeToArray
(String value, Class<T> type) <T> T[]
decodeToArray
(String value, Type type) <T> List
<T> decodeToList
(String value, Class<T> type) <T> List
<T> decodeToList
(String value, Type type) <T> Set
<T> decodeToSet
(String value, Class<T> type) <T> Set
<T> decodeToSet
(String value, Type type) decodeZonedDateTime
(String value) encode
(BigDecimal value) encode
(BigInteger value) encode
(InetAddress value) encode
(LocalDateTime value) encode
(ZonedDateTime value) <T> String
encode
(T value) Encodes the specified value to the encoded type.<T> String
Encodes the specified value whose type is represented by the specified class to the encoded type.<T> String
Encodes the specified value whose type is the specified type to the encoded type.<T> String
encodeArray
(T[] value) <T> String
encodeArray
(T[] value, Class<T> type) <T> String
encodeArray
(T[] value, Type type) <T> String
encodeList
(List<T> value) <T> String
encodeList
(List<T> value, Class<T> type) <T> String
encodeList
(List<T> value, Type 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.<T> String
<T> String
<T> String
-
Constructor Details
-
TextStringMediaTypeConverter
Creates a
text/plain
media type converter.- Parameters:
stringConverter
- the underlying string converter
-
-
Method Details
-
canConvert
Description copied from interface:MediaTypeConverter
Determines whether the converter can convert the specified media type.
- Specified by:
canConvert
in interfaceMediaTypeConverter<String>
- Parameters:
mediaType
- a media type- Returns:
- true if the converter can convert the media type, false otherwise
-
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<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:ReactiveDecoder
Decodes the specified stream of values whose type is the specified type into a mono stream of value.
- Specified by:
decodeOne
in 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: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<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:ReactiveDecoder
Decodes the specified stream of values whose type is the specified type into a flux stream of values.
- Specified by:
decodeMany
in 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:ReactiveEncoder
Encodes a mono stream of values to a stream of values.
- Specified by:
encodeOne
in 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: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,
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:ReactiveEncoder
Encodes a mono stream of values whose type is the specified type to a stream of values.
- Specified by:
encodeOne
in 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:ReactiveEncoder
Encodes a flux stream of values to a stream of values.
- Specified by:
encodeMany
in 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: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,
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:ReactiveEncoder
Encodes a flux stream of values whose type is the specified type to a stream of values.
- Specified by:
encodeMany
in 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
-
decodeToList
-
decodeToList
-
decodeToSet
-
decodeToSet
-
decodeToArray
-
decodeToArray
-
encodeList
- Throws:
ConverterException
-
encodeList
- Throws:
ConverterException
-
encodeList
- Throws:
ConverterException
-
encodeSet
- Throws:
ConverterException
-
encodeSet
- Throws:
ConverterException
-
encodeSet
- Throws:
ConverterException
-
encodeArray
- Throws:
ConverterException
-
encodeArray
- Throws:
ConverterException
-
encodeArray
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
encode
- Throws:
ConverterException
-
decodeByte
- Throws:
ConverterException
-
decodeShort
- Throws:
ConverterException
-
decodeInteger
- Throws:
ConverterException
-
decodeLong
- Throws:
ConverterException
-
decodeFloat
- Throws:
ConverterException
-
decodeDouble
- Throws:
ConverterException
-
decodeCharacter
- Throws:
ConverterException
-
decodeBoolean
- Throws:
ConverterException
-
decodeString
- Throws:
ConverterException
-
decodeBigInteger
- Throws:
ConverterException
-
decodeBigDecimal
- Throws:
ConverterException
-
decodeLocalDate
- Throws:
ConverterException
-
decodeLocalDateTime
- Throws:
ConverterException
-
decodeZonedDateTime
- Throws:
ConverterException
-
decodeCurrency
- Throws:
ConverterException
-
decodeLocale
- Throws:
ConverterException
-
decodeFile
- Throws:
ConverterException
-
decodePath
- Throws:
ConverterException
-
decodeURI
- Throws:
ConverterException
-
decodeURL
- Throws:
ConverterException
-
decodePattern
- Throws:
ConverterException
-
decodeInetAddress
- Throws:
ConverterException
-
decodeClass
- Throws:
ConverterException
-
decode
Description copied from interface:Decoder
Decodes the specified value to an object whose type is represented by the specified class.
- Specified by:
decode
in 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:Decoder
Decodes the specified value to an object of the specified type.
- Specified by:
decode
in 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:Encoder
Encodes the specified value to the encoded type.
- Specified by:
encode
in 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:Encoder
Encodes the specified value whose type is represented by the specified class to the encoded type.
- Specified by:
encode
in 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:Encoder
Encodes the specified value whose type is the specified type to the encoded type.
- Specified by:
encode
in 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
-