Class SerializeUtil
java.lang.Object
com.amazonaws.services.lambda.runtime.serialization.util.SerializeUtil
Class with Utilities for serializing and deserializing customer classes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertStreamToString(InputStream inputStream) converts an input stream to a stringstatic <T> TdeserializeDateTime(Class<T> dateTimeClass, String dateTimeString) deserialize a joda datetime object Underneath the reflection, this method does the following: DateTime.parse(jsonParser.getValueAsString());static ClassloadCustomerClass(String className, ClassLoader customerClassLoader) load a customer classstatic <T> StringserializeDateTime(T dateTime, ClassLoader classLoader) serialize a DateTime object Underneath the reflection, this method does the following: DateTimeFormatter formatter = ISODateTimeFormat.dateTime(); jsonGenerator.writeString(formatter.print(customerDateTime)
-
Constructor Details
-
SerializeUtil
public SerializeUtil()
-
-
Method Details
-
convertStreamToString
converts an input stream to a string- Parameters:
inputStream- InputStream object- Returns:
- String with stream contents
-
loadCustomerClass
load a customer class- Parameters:
className- name of class to load- Returns:
- Class object
-
deserializeDateTime
deserialize a joda datetime object Underneath the reflection, this method does the following: DateTime.parse(jsonParser.getValueAsString());- Type Parameters:
T- DateTime type- Parameters:
dateTimeClass- DateTime classdateTimeString- string to deserialize from- Returns:
- DateTime instance
-
serializeDateTime
serialize a DateTime object Underneath the reflection, this method does the following: DateTimeFormatter formatter = ISODateTimeFormat.dateTime(); jsonGenerator.writeString(formatter.print(customerDateTime)- Type Parameters:
T- DateTime type- Parameters:
dateTime- DateTime object to serializeclassLoader- ClassLoader used to load DateTime classes- Returns:
- timestamp as formatted string
-