Class SpecificSerdeCache
java.lang.Object
io.micronaut.serde.support.util.SpecificSerdeCache
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Deserializer<T> findDeserializer(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<T> type) Finds the specific deserializer of a type.<T> Deserializer<T> findDeserializer(DeserializerLocator locator, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<T> type) 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.<T> Serializer<T> findSerializer(Serializer.EncoderContext context, io.micronaut.core.type.Argument<T> type) Finds the specific serializer of a type.<T> Serializer<T> findSerializer(SerializerLocator locator, Serializer.EncoderContext context, io.micronaut.core.type.Argument<T> type) 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.intsize()The number of cached serializers and deserializers.
-
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 documenttype- 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 serializercontext- The context of the documenttype- 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 documenttype- 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 deserializercontext- The context of the documenttype- 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
-