Interface Decoder<From,To>

Type Parameters:
From - the encoded type
To - the decoded type
All Known Subinterfaces:
CompoundDecoder<From,To>, Converter<A,B>, MediaTypeConverter<From>, ObjectConverter<From>, PrimitiveDecoder<From>, ReactiveConverter<A,B>, ReactiveDecoder<From,To>, SplittableDecoder<From,To>, SplittablePrimitiveDecoder<From>
All Known Implementing Classes:
ByteBufConverter, CompositeConverter, CompositeDecoder, JacksonByteBufConverter, JacksonStringConverter, JsonByteBufMediaTypeConverter, JsonStringMediaTypeConverter, NdJsonByteBufMediaTypeConverter, NdJsonStringMediaTypeConverter, ObjectDecoder, ParameterConverter, StringCompositeConverter, StringConverter, TextByteBufMediaTypeConverter, TextStringMediaTypeConverter

public interface Decoder<From,To>

A decoder is used to decode an object into another object.

Since:
1.0
Author:
Jeremy Kuhn
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends To>
    T
    decode(From value, Class<T> type)
    Decodes the specified value to an object whose type is represented by the specified class.
    <T extends To>
    T
    decode(From value, Type type)
    Decodes the specified value to an object of the specified type.
  • Method Details

    • decode

      <T extends To> T decode(From value, Class<T> type) throws ConverterException

      Decodes the specified value to an object whose type is represented by the specified class.

      Type Parameters:
      T - the type of the decoded object
      Parameters:
      value - the object to decode
      type - the class of the decoded object
      Returns:
      a decoded object
      Throws:
      ConverterException - if there was an error decoding the value
    • decode

      <T extends To> T decode(From value, Type type) throws ConverterException

      Decodes the specified value to an object of the specified type.

      Type Parameters:
      T - the type of the decoded object
      Parameters:
      value - the object to decode
      type - the type of the decoded object
      Returns:
      a decoded object
      Throws:
      ConverterException - if there was an error decoding the value