Class JsonUtils

java.lang.Object
com.mojang.realmsclient.util.JsonUtils

public class JsonUtils extends Object
  • Constructor Details

    • JsonUtils

      public JsonUtils()
  • Method Details

    • getRequired

      public static <T> T getRequired(String key, com.google.gson.JsonObject json, Function<com.google.gson.JsonObject,T> output)
    • getOptional

      @Nullable public static <T> T getOptional(String key, com.google.gson.JsonObject json, Function<com.google.gson.JsonObject,T> output)
    • getRequiredString

      public static String getRequiredString(String key, com.google.gson.JsonObject json)
    • getRequiredStringOr

      public static String getRequiredStringOr(String key, com.google.gson.JsonObject json, String defaultValue)
    • getStringOr

      @Nullable public static String getStringOr(String key, com.google.gson.JsonObject json, @Nullable String defaultValue)
    • getUuidOr

      @Nullable public static UUID getUuidOr(String key, com.google.gson.JsonObject json, @Nullable UUID defaultValue)
    • getIntOr

      public static int getIntOr(String key, com.google.gson.JsonObject json, int defaultValue)
    • getLongOr

      public static long getLongOr(String key, com.google.gson.JsonObject json, long defaultValue)
    • getBooleanOr

      public static boolean getBooleanOr(String key, com.google.gson.JsonObject json, boolean defaultValue)
    • getDateOr

      public static Date getDateOr(String key, com.google.gson.JsonObject json)