Interface CodecRegistry

  • All Superinterfaces:

    public interface CodecRegistry
    extends CodecProvider
    A registry of Codec instances searchable by the class that the Codec can encode and decode.

    While the CodecRegistry interface adds no stipulations to the general contract for the Object.equals, programmers who implement the CodecRegistry interface "directly" must exercise care if they choose to override the Object.equals. It is not necessary to do so, and the simplest course of action is to rely on Object's implementation, but the implementer may wish to implement a "value comparison" in place of the default "reference comparison."

    As of the 4.0 release, this class extends the CodecProvider interface. This capability was introduced to enable nesting registries inside another registry.

    • Method Detail

      • get

        <T> Codec<T> get​(Class<T> clazz)
        Gets a Codec for the given Class.
        Type Parameters:
        T - the class type
        clazz - the class
        a codec for the given class
        CodecConfigurationException - if the registry does not contain a codec for the given class.