Interface CodecService


  • public interface CodecService
    Service for registering and retrieving JSON codecs for various entities.
    • Method Detail

      • getCodecs

        Set<Class<?>> getCodecs()
        Returns the set of classes with currently registered codecs.
        Returns:
        set of entity classes
      • getCodec

        <T> JsonCodec<T> getCodec​(Class<T> entityClass)
        Returns the JSON codec for the specified entity class.
        Type Parameters:
        T - entity type
        Parameters:
        entityClass - entity class
        Returns:
        JSON codec; null if no codec available for the class
      • registerCodec

        <T> void registerCodec​(Class<T> entityClass,
                               JsonCodec<T> codec)
        Registers the specified JSON codec for the given entity class.
        Type Parameters:
        T - entity type
        Parameters:
        entityClass - entity class
        codec - JSON codec
      • unregisterCodec

        void unregisterCodec​(Class<?> entityClass)
        Unregisters the JSON codec for the specified entity class.
        Parameters:
        entityClass - entity class