Package io.github.emcw.utils
Class GsonUtil
java.lang.Object
io.github.emcw.utils.GsonUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.gson.JsonArray
arrAsJsonArray
(Object[] objects) static Stream<com.google.gson.JsonElement>
arrAsStream
(@NotNull com.google.gson.JsonArray arr) static int[]
arrToIntArr
(@NotNull com.google.gson.JsonArray arr) static <T extends com.google.gson.JsonElement>
Tstatic <T> T
static <T> T
deserialize
(com.google.gson.JsonElement el, Type type) static <T> T
deserialize
(String str, Class<T> c) static <T> T
deserialize
(String str, Type type) difference
(com.google.gson.JsonArray ops, com.google.gson.JsonArray residents) difference
(com.google.gson.JsonArray ops, com.google.gson.JsonArray residents, String key) static <T> Type
static <T> Type
getType
(T obj) intersection
(com.google.gson.JsonArray arr, com.google.gson.JsonArray arr2) static com.google.gson.JsonArray
static @NotNull Boolean
static @Nullable Integer
static @Nullable com.google.gson.JsonObject
static @Nullable String
static <T> @NotNull com.google.gson.JsonArray
static @NotNull com.google.gson.JsonObject
static String
strArrAsStream
(@NotNull String[] arr) streamEntries
(@NotNull com.google.gson.JsonObject o) streamEntries
(@NotNull Map<String, T> o) static <T> Stream<T>
streamValues
(@NotNull Map<String, T> o) static <T> List<T>
static <T> com.google.gson.JsonObject
valueAsObj
(Map.Entry<String, T> entry)
-
Constructor Details
-
GsonUtil
public GsonUtil()
-
-
Method Details
-
serialize
-
getType
-
getType
-
deserialize
-
deserialize
-
deserialize
-
convert
-
asTree
-
toList
-
mapToArr
-
arrToMap
-
arrToIntArr
public static int[] arrToIntArr(@NotNull @NotNull com.google.gson.JsonArray arr) -
strArrAsStream
-
arrAsStream
public static Stream<com.google.gson.JsonElement> arrAsStream(@NotNull @NotNull com.google.gson.JsonArray arr) -
streamEntries
-
streamEntries
-
streamValues
-
intersection
-
difference
-
difference
-
valueAsObj
-
keyAsObj
@Nullable public static @Nullable com.google.gson.JsonObject keyAsObj(com.google.gson.JsonObject o, String k) -
keyAsBool
-
keyAsInt
-
keyAsStr
-
keyAsArr
-
mapToObj
-
arrAsJsonArray
-