@NonnullByDefault public interface GsonConverter
JsonElement family of classes, and standard Java types.
All conversions are deep, meaning for collections, contained values are also converted.
| Modifier and Type | Method and Description |
|---|---|
Object |
unwarpPrimitive(JsonPrimitive primitive)
Extracts the underlying
Object from an JsonPrimitive. |
List<Object> |
unwrapArray(JsonArray array)
|
Set<Object> |
unwrapArrayToSet(JsonArray array)
|
Object |
unwrapElement(JsonElement element)
Converts a
JsonElement to a Object. |
Map<String,Object> |
unwrapObject(JsonObject object)
Converts a
JsonObject to a Map. |
JsonElement |
wrap(Object object)
Tries to wrap an object to a
JsonElement. |
Map<String,Object> unwrapObject(JsonObject object)
JsonObject to a Map.object - the json objectList<Object> unwrapArray(JsonArray array)
array - the json arraySet<Object> unwrapArrayToSet(JsonArray array)
array - the json arrayObject unwarpPrimitive(JsonPrimitive primitive)
Object from an JsonPrimitive.primitive - the json primitive@Nullable Object unwrapElement(JsonElement element)
JsonElement to a Object.element - the json elementJsonElement wrap(Object object)
JsonElement.
Supported types: String, Number, Boolean,
Character, Iterable, and Map, where the key is a String.
object - the object to wrapCopyright © 2017. All rights reserved.