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 node, Function<com.google.gson.JsonObject, T> parser)
    • getOptional

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

      public static String getRequiredString(String key, com.google.gson.JsonObject node)
    • getStringOr

      @Contract("_,_,!null->!null;_,_,null->_") public static @Nullable String getStringOr(String key, com.google.gson.JsonObject node, @Nullable String defaultValue)
    • getUuidOr

      @Contract("_,_,!null->!null;_,_,null->_") public static @Nullable UUID getUuidOr(String key, com.google.gson.JsonObject node, @Nullable UUID defaultValue)
    • getIntOr

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

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

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

      public static Instant getDateOr(String key, com.google.gson.JsonObject node)