Package com.mojang.realmsclient.util
Class JsonUtils
java.lang.Object
com.mojang.realmsclient.util.JsonUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetBooleanOr(String key, JsonObject json, boolean defaultValue) static InstantgetDateOr(String key, JsonObject json) static intgetIntOr(String key, JsonObject json, int defaultValue) static longgetLongOr(String key, JsonObject json, long defaultValue) static <T> @Nullable TgetOptional(String key, JsonObject json, Function<JsonObject, T> output) static <T> TgetRequired(String key, JsonObject json, Function<JsonObject, T> output) static StringgetRequiredString(String key, JsonObject json) static @Nullable StringgetStringOr(String key, JsonObject json, @Nullable String defaultValue) static @Nullable UUIDgetUuidOr(String key, JsonObject json, @Nullable UUID defaultValue)
-
Constructor Details
-
JsonUtils
public JsonUtils()
-
-
Method Details
-
getRequired
-
getOptional
public static <T> @Nullable T getOptional(String key, JsonObject json, Function<JsonObject, T> output) -
getRequiredString
-
getStringOr
@Contract("_,_,!null->!null;_,_,null->_") public static @Nullable String getStringOr(String key, JsonObject json, @Nullable String defaultValue) -
getUuidOr
@Contract("_,_,!null->!null;_,_,null->_") public static @Nullable UUID getUuidOr(String key, JsonObject json, @Nullable UUID defaultValue) -
getIntOr
-
getLongOr
-
getBooleanOr
-
getDateOr
-