Class GeneratedSerdeFallbackUtil
java.lang.Object
io.micronaut.serde.util.GeneratedSerdeFallbackUtil
Fallback helpers used by generated serdes when a runtime object serde is required.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Deserializer<?> runtimeFormattedEnumDeserializer(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<?> type, FormatConfiguration format) Returns a runtime formatted deserializer for generated enum deserializers.static Serializer<?> runtimeFormattedEnumSerializer(Serializer.EncoderContext context, io.micronaut.core.type.Argument<?> type, FormatConfiguration format) Returns a runtime formatted serializer for generated enum serializers.static Deserializer<?> withRuntimeEnumFallback(Deserializer<?> generatedDeserializer, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<?> type) Returns the generated enum deserializer unless feature override metadata requires the runtime enum deserializer.static Serializer<?> withRuntimeEnumFallback(Serializer<?> generatedSerializer, Serializer.EncoderContext context, io.micronaut.core.type.Argument<?> type) Returns the generated enum serializer unless feature override metadata requires the runtime enum serializer.static Deserializer<?> withRuntimeObjectFallback(Deserializer<?> generatedDeserializer, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<?> type) Returns the generated deserializer unless the active features require the runtime object deserializer.static Serializer<?> withRuntimeObjectFallback(Serializer<?> generatedSerializer, Serializer.EncoderContext context, io.micronaut.core.type.Argument<?> type) Returns the generated serializer unless the active features require the runtime object serializer.
-
Method Details
-
withRuntimeObjectFallback
public static Deserializer<?> withRuntimeObjectFallback(Deserializer<?> generatedDeserializer, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<?> type) throws SerdeException Returns the generated deserializer unless the active features require the runtime object deserializer.- Parameters:
generatedDeserializer- The generated deserializercontext- The decoder contexttype- The target type- Returns:
- The generated deserializer or a runtime object deserializer
- Throws:
SerdeException- If no deserializer can be resolved- Since:
- 3.0
-
withRuntimeObjectFallback
public static Serializer<?> withRuntimeObjectFallback(Serializer<?> generatedSerializer, Serializer.EncoderContext context, io.micronaut.core.type.Argument<?> type) throws SerdeException Returns the generated serializer unless the active features require the runtime object serializer.- Parameters:
generatedSerializer- The generated serializercontext- The encoder contexttype- The target type- Returns:
- The generated serializer or a runtime object serializer
- Throws:
SerdeException- If no serializer can be resolved- Since:
- 3.0
-
withRuntimeEnumFallback
public static Serializer<?> withRuntimeEnumFallback(Serializer<?> generatedSerializer, Serializer.EncoderContext context, io.micronaut.core.type.Argument<?> type) throws SerdeException Returns the generated enum serializer unless feature override metadata requires the runtime enum serializer.- Parameters:
generatedSerializer- The generated enum serializercontext- The encoder contexttype- The target type- Returns:
- The generated serializer or a runtime enum serializer
- Throws:
SerdeException- If no serializer can be resolved- Since:
- 3.0
-
withRuntimeEnumFallback
public static Deserializer<?> withRuntimeEnumFallback(Deserializer<?> generatedDeserializer, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<?> type) throws SerdeException Returns the generated enum deserializer unless feature override metadata requires the runtime enum deserializer.- Parameters:
generatedDeserializer- The generated enum deserializercontext- The decoder contexttype- The target type- Returns:
- The generated deserializer or a runtime enum deserializer
- Throws:
SerdeException- If no deserializer can be resolved- Since:
- 3.0
-
runtimeFormattedEnumSerializer
public static Serializer<?> runtimeFormattedEnumSerializer(Serializer.EncoderContext context, io.micronaut.core.type.Argument<?> type, FormatConfiguration format) throws SerdeException Returns a runtime formatted serializer for generated enum serializers.- Parameters:
context- The encoder contexttype- The target typeformat- The format configuration- Returns:
- A runtime formatted enum serializer
- Throws:
SerdeException- If no serializer can be resolved- Since:
- 3.0
-
runtimeFormattedEnumDeserializer
public static Deserializer<?> runtimeFormattedEnumDeserializer(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<?> type, FormatConfiguration format) throws SerdeException Returns a runtime formatted deserializer for generated enum deserializers.- Parameters:
context- The decoder contexttype- The target typeformat- The format configuration- Returns:
- A runtime formatted enum deserializer
- Throws:
SerdeException- If no deserializer can be resolved- Since:
- 3.0
-