Interface CodecFactory

All Known Implementing Classes:
ForyCodecFactory, GsonCodecFactory, Jackson2CodecFactory, JacksonCodecFactory, JsonbCodecFactory, ProtobufCodecFactory

public interface CodecFactory
Produces Codec instances for arbitrary types, backed by a serialization library.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> Codec<T>
    create(Class<T> type)
    Creates a codec for a non-generic class.
    <T> Codec<T>
    create(TypeRef<T> typeRef)
    Creates a codec for the given type reference, supporting full generic types.
  • Method Details

    • create

      <T> Codec<T> create(TypeRef<T> typeRef)
      Creates a codec for the given type reference, supporting full generic types.
      Type Parameters:
      T - the codec's value type
      Parameters:
      typeRef - the type to create a codec for
      Returns:
      a codec for the type
    • create

      default <T> Codec<T> create(Class<T> type)
      Creates a codec for a non-generic class.
      Type Parameters:
      T - the codec's value type
      Parameters:
      type - the class to create a codec for
      Returns:
      a codec for the class