public class GsonHelper extends Object
构造器和说明 |
---|
GsonHelper() |
限定符和类型 | 方法和说明 |
---|---|
static com.google.gson.JsonObject |
buildJsonObject(Object... keyOrValue)
快速构建JsonObject对象,批量添加一堆属性
|
static Boolean |
getAsBoolean(com.google.gson.JsonElement element) |
static Double |
getAsDouble(com.google.gson.JsonElement element) |
static Float |
getAsFloat(com.google.gson.JsonElement element) |
static Integer |
getAsInteger(com.google.gson.JsonElement element) |
static com.google.gson.JsonArray |
getAsJsonArray(com.google.gson.JsonElement element) |
static Long |
getAsLong(com.google.gson.JsonElement element) |
static boolean |
getAsPrimitiveBool(com.google.gson.JsonElement element) |
static double |
getAsPrimitiveDouble(com.google.gson.JsonElement element) |
static float |
getAsPrimitiveFloat(com.google.gson.JsonElement element) |
static int |
getAsPrimitiveInt(com.google.gson.JsonElement element) |
static long |
getAsPrimitiveLong(com.google.gson.JsonElement element) |
static String |
getAsString(com.google.gson.JsonElement element) |
static Boolean |
getBoolean(com.google.gson.JsonObject json,
String property) |
static Double |
getDouble(com.google.gson.JsonObject json,
String property) |
static Float |
getFloat(com.google.gson.JsonObject json,
String property) |
static Integer[] |
getIntArray(com.google.gson.JsonObject o,
String string) |
static Integer |
getInteger(com.google.gson.JsonObject json,
String property) |
static Long |
getLong(com.google.gson.JsonObject json,
String property) |
static Long[] |
getLongArray(com.google.gson.JsonObject o,
String string) |
static double |
getPrimitiveDouble(com.google.gson.JsonObject json,
String property) |
static float |
getPrimitiveFloat(com.google.gson.JsonObject json,
String property) |
static int |
getPrimitiveInteger(com.google.gson.JsonObject json,
String property) |
static long |
getPrimitiveLong(com.google.gson.JsonObject json,
String property) |
static String |
getString(com.google.gson.JsonObject json,
String property) |
static String[] |
getStringArray(com.google.gson.JsonObject o,
String string) |
static boolean |
isNotNull(com.google.gson.JsonElement element) |
static boolean |
isNull(com.google.gson.JsonElement element) |
static void |
put(com.google.gson.JsonObject jsonObject,
Object... keyOrValue)
批量向JsonObject对象中添加属性
|
public static boolean isNull(com.google.gson.JsonElement element)
public static boolean isNotNull(com.google.gson.JsonElement element)
public static long getPrimitiveLong(com.google.gson.JsonObject json, String property)
public static int getPrimitiveInteger(com.google.gson.JsonObject json, String property)
public static double getPrimitiveDouble(com.google.gson.JsonObject json, String property)
public static float getPrimitiveFloat(com.google.gson.JsonObject json, String property)
public static String getAsString(com.google.gson.JsonElement element)
public static Long getAsLong(com.google.gson.JsonElement element)
public static long getAsPrimitiveLong(com.google.gson.JsonElement element)
public static Integer getAsInteger(com.google.gson.JsonElement element)
public static int getAsPrimitiveInt(com.google.gson.JsonElement element)
public static Boolean getAsBoolean(com.google.gson.JsonElement element)
public static boolean getAsPrimitiveBool(com.google.gson.JsonElement element)
public static Double getAsDouble(com.google.gson.JsonElement element)
public static double getAsPrimitiveDouble(com.google.gson.JsonElement element)
public static Float getAsFloat(com.google.gson.JsonElement element)
public static float getAsPrimitiveFloat(com.google.gson.JsonElement element)
public static com.google.gson.JsonArray getAsJsonArray(com.google.gson.JsonElement element)
public static com.google.gson.JsonObject buildJsonObject(Object... keyOrValue)
keyOrValue
- 包含key或value的数组public static void put(com.google.gson.JsonObject jsonObject, Object... keyOrValue)
jsonObject
- 原始JsonObject对象keyOrValue
- 包含key或value的数组Copyright © 2024. All rights reserved.