Serializes objects to/from JSON.
The `Serializer` class is a thin wrapper around the Jackson ObjectMapper. While it is primarily intended to serialize LIF objects, there is nothing that prevents it from serializing arbitrary Java objects.
Since the Jackson ObjectMapper is thread-safe the Serializer class is also thread-safe.
Type | Name and description |
---|---|
static T |
parse(String json, Class<T> theClass) Parses a JSON string and creates an instance of the specified class. |
static Data<Object> |
parse(String json) |
static String |
toJson(Object object) Returns a JSON representation of the object. |
static String |
toPrettyJson(Object object) Returns a pretty-printed JSON representation of the object. |
Parses a JSON string and creates an instance of the specified class. TODO (not before v3.0.0) Rethrow exceptions as LappsIoExceptions
Returns a JSON representation of the object. TODO (not before v3.0.0) Rethrow exceptions as LappsIoExceptions