public class JsonRecordParser<E> extends Object implements RecordParser<E>
RecordParser
}, serializes and deserializes a an
object E to json string.RecordParser
Modifier and Type | Field and Description |
---|---|
Class<E> |
clazz |
static com.google.gson.Gson |
gson |
Constructor and Description |
---|
JsonRecordParser(Class<E> clazz) |
public E decode(String record)
RecordParser
decode
in interface RecordParser<E>
record
- the string containing the serialized objectpublic String encode(E obj)
RecordParser
encode
in interface RecordParser<E>
obj
- the object to serializeCopyright © 2013. All rights reserved.