Interface PropertyCodecProvider



  • public interface PropertyCodecProvider
    A variant of CodecProvider that generates codecs for PojoCodec.

    This is a specialized codec provider that retrieves codecs which account for type parameters associated with a property. In particular this should only be used to add support for custom container types like optionals. It's only applicable for use by PojoCodec registered through PojoCodecProvider.builder().

    Since:
    3.6
    • Method Detail

      • get

        <T> Codec<T> get​(TypeWithTypeParameters<T> type,
                         PropertyCodecRegistry registry)
        Get a Codec using the given context, which includes, most importantly, the class and bound type parameters for which a Codec is required.
        Type Parameters:
        T - the type of the class for which a Codec is required
        Parameters:
        type - the class and bound type parameters for which to get a Codec
        registry - the registry to use for resolving dependent Codec instances
        Returns:
        the Codec instance, which may be null, if this source is unable to provide one for the requested Class