Class GSONUtils

java.lang.Object
com.ticxo.modelengine.api.utils.data.GSONUtils

public class GSONUtils extends Object
  • Constructor Details

    • GSONUtils

      public GSONUtils()
  • Method Details

    • ifPresent

      public static void ifPresent(com.google.gson.JsonElement element, String key, Consumer<com.google.gson.JsonElement> consumer)
    • ifArray

      public static void ifArray(com.google.gson.JsonElement element, String key, Consumer<com.google.gson.JsonElement> forEach)
    • ifArray

      public static void ifArray(com.google.gson.JsonElement element, String key, BiConsumer<Integer,com.google.gson.JsonElement> forEach)
    • get

      @Nullable public static <T> T get(com.google.gson.JsonElement element, String key, Function<com.google.gson.JsonElement,T> func)
    • get

      @NotNull public static <T> T get(com.google.gson.JsonElement element, String key, Function<com.google.gson.JsonElement,T> func, @NotNull T def)