Class SpecificSerdeCache

java.lang.Object
io.micronaut.serde.support.util.SpecificSerdeCache

@Internal public final class SpecificSerdeCache extends Object
The specific serdes a mapper creates for the documents it reads and writes, kept for the next documents when creating them did not bind them to the document.
Since:
3.3
  • Constructor Details

    • SpecificSerdeCache

      public SpecificSerdeCache()
  • Method Details

    • findSerializer

      public <T> Serializer<T> findSerializer(Serializer.EncoderContext context, io.micronaut.core.type.Argument<T> type) throws SerdeException
      Finds the specific serializer of a type.
      Type Parameters:
      T - The type
      Parameters:
      context - The context of the document
      type - The type
      Returns:
      The specific serializer
      Throws:
      SerdeException - If no serializer is found
    • findSerializer

      public <T> Serializer<T> findSerializer(SerializerLocator locator, Serializer.EncoderContext context, io.micronaut.core.type.Argument<T> type) throws SerdeException
      Finds the specific serializer of a type, looked up in the given locator, such as the registry of the mapper, when it is not cached.
      Type Parameters:
      T - The type
      Parameters:
      locator - The locator of the serializer
      context - The context of the document
      type - The type
      Returns:
      The specific serializer
      Throws:
      SerdeException - If no serializer is found
    • findDeserializer

      public <T> Deserializer<T> findDeserializer(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<T> type) throws SerdeException
      Finds the specific deserializer of a type.
      Type Parameters:
      T - The type
      Parameters:
      context - The context of the document
      type - The type
      Returns:
      The specific deserializer
      Throws:
      SerdeException - If no deserializer is found
    • findDeserializer

      public <T> Deserializer<T> findDeserializer(DeserializerLocator locator, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<T> type) throws SerdeException
      Finds the specific deserializer of a type, looked up in the given locator, such as the registry of the mapper, when it is not cached.
      Type Parameters:
      T - The type
      Parameters:
      locator - The locator of the deserializer
      context - The context of the document
      type - The type
      Returns:
      The specific deserializer
      Throws:
      SerdeException - If no deserializer is found
    • size

      public int size()
      The number of cached serializers and deserializers.
      Returns:
      The size