public class SerializeUtil extends Object
Constructor and Description |
---|
SerializeUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
convertStreamToString(InputStream inputStream)
converts an input stream to a string
|
static <T> T |
deserializeDateTime(Class<T> dateTimeClass,
String dateTimeString)
deserialize a joda datetime object
Underneath the reflection, this method does the following:
DateTime.parse(jsonParser.getValueAsString());
|
static Class |
loadCustomerClass(String className,
ClassLoader customerClassLoader)
load a customer class
|
static <T> String |
serializeDateTime(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)
|
public static String convertStreamToString(InputStream inputStream)
inputStream
- InputStream objectpublic static Class loadCustomerClass(String className, ClassLoader customerClassLoader)
className
- name of class to loadpublic static <T> T deserializeDateTime(Class<T> dateTimeClass, String dateTimeString)
T
- DateTime typedateTimeClass
- DateTime classdateTimeString
- string to deserialize frompublic static <T> String serializeDateTime(T dateTime, ClassLoader classLoader)
T
- DateTime typedateTime
- DateTime object to serializeclassLoader
- ClassLoader used to load DateTime classesCopyright © 2023. All rights reserved.