Interface CodecService


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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> JsonCodec<T> getCodec​(java.lang.Class<T> entityClass)
      Returns the JSON codec for the specified entity class.
      java.util.Set<java.lang.Class<?>> getCodecs()
      Returns the set of classes with currently registered codecs.
      <T> void registerCodec​(java.lang.Class<T> entityClass, JsonCodec<T> codec)
      Registers the specified JSON codec for the given entity class.
      void unregisterCodec​(java.lang.Class<?> entityClass)
      Unregisters the JSON codec for the specified entity class.
    • Method Detail

      • getCodecs

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

        <T> JsonCodec<T> getCodec​(java.lang.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​(java.lang.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​(java.lang.Class<?> entityClass)
        Unregisters the JSON codec for the specified entity class.
        Parameters:
        entityClass - entity class