public interface JSONFormatter
Modifier and Type | Field and Description |
---|---|
static com.google.gson.Gson |
GSON |
static com.google.gson.JsonSerializer<Double> |
INVALID_DOUBLES |
Modifier and Type | Method and Description |
---|---|
String |
asJSON()
Convert this object to a JSON string.
|
static String |
asJSON(Object object)
Returns a JSON string representation of object.
|
static <T extends JSONFormatter> |
fromJSON(String json,
Class<T> clazz)
Returns a deserialized object from JSON using
GSON . |
static final com.google.gson.JsonSerializer<Double> INVALID_DOUBLES
static final com.google.gson.Gson GSON
static String asJSON(Object object)
object
- The object to make a JSON out of.static <T extends JSONFormatter> T fromJSON(String json, Class<T> clazz)
GSON
.T
- The type of the object. It must implement JSONFormatter
.json
- The String json that represents the object.clazz
- The class of the object.String asJSON()
Copyright © 2021. All rights reserved.