Package io.micronaut.function.aws
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull io.micronaut.json.JsonMapper
<T> T
fromJson
(InputStream input, Type type) <T> T
io.micronaut.json.JsonMapper
<T> void
toJson
(T value, OutputStream output, Type type)
-
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
- Specified by:
fromJson
in interfacecom.amazonaws.services.lambda.runtime.CustomPojoSerializer
-
fromJson
- Specified by:
fromJson
in interfacecom.amazonaws.services.lambda.runtime.CustomPojoSerializer
-
toJson
- Specified by:
toJson
in interfacecom.amazonaws.services.lambda.runtime.CustomPojoSerializer
-