- Type Parameters:
From
- the type of object to encodeTo
- the type of the encoded object
- All Known Subinterfaces:
CompoundEncoder<From,
,To> Converter<A,
,B> JoinableEncoder<From,
,To> JoinablePrimitiveEncoder<To>
,MediaTypeConverter<From>
,ObjectConverter<From>
,PrimitiveEncoder<To>
,ReactiveConverter<A,
,B> ReactiveEncoder<From,
To>
- All Known Implementing Classes:
ByteBufConverter
,CompositeConverter
,CompositeEncoder
,JacksonByteBufConverter
,JacksonStringConverter
,JsonByteBufMediaTypeConverter
,JsonStringMediaTypeConverter
,NdJsonByteBufMediaTypeConverter
,NdJsonStringMediaTypeConverter
,ParameterConverter
,StringCompositeConverter
,StringConverter
,TextByteBufMediaTypeConverter
,TextStringMediaTypeConverter
public interface Encoder<From,To>
An encoder is used to encode an object into another object.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionencode
(T value) Encodes the specified value to the encoded type.Encodes the specified value whose type is represented by the specified class to the encoded type.Encodes the specified value whose type is the specified type to the encoded type.
-
Method Details
-
encode
Encodes the specified value to the encoded type.
- 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
Encodes the specified value whose type is represented by the specified class to the encoded type.
- 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
Encodes the specified value whose type is the specified type to the encoded type.
- 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
-