Class GeneratedSerdeFallbackUtil

java.lang.Object
io.micronaut.serde.util.GeneratedSerdeFallbackUtil

@Internal public final class GeneratedSerdeFallbackUtil extends Object
Fallback helpers used by generated serdes when a runtime object serde is required.
Since:
3.0
  • 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 deserializer
      context - The decoder context
      type - 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 serializer
      context - The encoder context
      type - 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 serializer
      context - The encoder context
      type - 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 deserializer
      context - The decoder context
      type - 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 context
      type - The target type
      format - 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 context
      type - The target type
      format - The format configuration
      Returns:
      A runtime formatted enum deserializer
      Throws:
      SerdeException - If no deserializer can be resolved
      Since:
      3.0