Class LambdaEventSerializers
- java.lang.Object
-
- com.amazonaws.services.lambda.runtime.serialization.events.LambdaEventSerializers
-
public class LambdaEventSerializers extends Object
This class provides serializers for Lambda supported events. HOW TO ADD SUPPORT FOR A NEW EVENT MODEL: Option 1 (Preferred): 1. Add Class name to SUPPORTED_EVENTS 2. Add Mixin Class to com.amazonaws.services.lambda.runtime.serialization.events.mixins package (if needed) 3. Add entries to MIXIN_MAP for event class and sub classes (if needed) 4. Add entries to NESTED_CLASS_MAP for event class and sub classes (if needed) 5. Add entry to NAMING_STRATEGY_MAP (if needed i.e. Could be used in place of a mixin) Option 2 (longer - for event models that do not work with Jackson or GSON): 1. Add Class name to SUPPORTED_EVENTS 2. Add serializer (using org.json) to com.amazonaws.services.lambda.runtime.serialization.events.serializers 3. Add class name and serializer to SERIALIZER_MAP
-
-
Constructor Summary
Constructors Constructor Description LambdaEventSerializers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isLambdaSupportedEvent(String className)
Returns whether the class name is a Lambda supported event model.static <T> PojoSerializer<T>
serializerFor(Class<T> eventClass, ClassLoader classLoader)
Return a serializer for the event class
-
-
-
Method Detail
-
isLambdaSupportedEvent
public static boolean isLambdaSupportedEvent(String className)
Returns whether the class name is a Lambda supported event model.- Parameters:
className
- class name as string- Returns:
- whether the event model is supported
-
serializerFor
public static <T> PojoSerializer<T> serializerFor(Class<T> eventClass, ClassLoader classLoader)
Return a serializer for the event class- Returns:
- a specific PojoSerializer or modified JacksonFactory instance with mixins and modules added in
-
-