Class GSONUtils
java.lang.Object
com.ticxo.modelengine.api.utils.data.GSONUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Tstatic <T> Tget(com.google.gson.JsonElement element, String key, Function<com.google.gson.JsonElement, T> func, T def) static <T> Tstatic Float[]getAsFloatArray(com.google.gson.JsonElement jsonElement) static UUIDgetAsUUID(com.google.gson.JsonElement jsonElement) static voidifArray(com.google.gson.JsonElement element, String key, BiConsumer<Integer, com.google.gson.JsonElement> forEach) static voidifArray(com.google.gson.JsonElement element, String key, Consumer<com.google.gson.JsonElement> forEach) static voidifPresent(com.google.gson.JsonElement element, String key, Consumer<com.google.gson.JsonElement> consumer)
-
Constructor Details
-
GSONUtils
public GSONUtils()
-
-
Method Details
-
ifPresent
-
ifArray
-
ifArray
public static void ifArray(com.google.gson.JsonElement element, String key, BiConsumer<Integer, com.google.gson.JsonElement> forEach) -
get
-
get
-
get
@NotNull public static <T> T get(com.google.gson.JsonElement element, Function<com.google.gson.JsonElement, T> func, @NotNull T def) -
getAsFloatArray
-
getAsUUID
-