Class JsonMapperCustomPojoSerializer

java.lang.Object
io.micronaut.function.aws.JsonMapperCustomPojoSerializer
All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.CustomPojoSerializer
Direct Known Subclasses:
SerdeCustomPojoSerializer

public class JsonMapperCustomPojoSerializer extends Object implements com.amazonaws.services.lambda.runtime.CustomPojoSerializer
Provides an implementation of CustomPojoSerializer which is loaded via SPI. This implementation avoids paying a double hit on performance when using a serialization library inside the Lambda function.
Since:
4.0.0
Author:
Sergio del Amo
  • Field Details

    • jsonMapper

      protected io.micronaut.json.JsonMapper jsonMapper
  • Constructor Details

    • JsonMapperCustomPojoSerializer

      public JsonMapperCustomPojoSerializer()
  • Method Details

    • createDefault

      @NonNull protected @NonNull io.micronaut.json.JsonMapper createDefault()
      Returns:
      A JsonMapper
    • getJsonMapper

      public io.micronaut.json.JsonMapper getJsonMapper()
      Returns:
      The Json Mapper
    • fromJson

      public <T> T fromJson(InputStream input, Type type)
      Specified by:
      fromJson in interface com.amazonaws.services.lambda.runtime.CustomPojoSerializer
    • fromJson

      public <T> T fromJson(String input, Type type)
      Specified by:
      fromJson in interface com.amazonaws.services.lambda.runtime.CustomPojoSerializer
    • toJson

      public <T> void toJson(T value, OutputStream output, Type type)
      Specified by:
      toJson in interface com.amazonaws.services.lambda.runtime.CustomPojoSerializer