@Deprecated
@ParametersAreNonnullByDefault
public class CodecUtils
extends java.lang.Object
| Constructor and Description |
|---|
CodecUtils()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsArray(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Check if the given json object contains a json array.
|
static boolean |
containsObject(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Check if the given json object contains a json object.
|
static boolean |
containsString(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Check if the given json object contains a boolean.
|
static boolean |
isNumber(com.google.gson.JsonElement element)
Deprecated.
Check if the given element is a number.
|
static boolean |
isObject(com.google.gson.JsonElement element)
Deprecated.
Check if the given element is an array.
|
static boolean |
isString(com.google.gson.JsonElement element)
Deprecated.
Check if the given element is a string.
|
static java.lang.Boolean |
optionalBoolean(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
Deprecated.
Get an optional boolean or null if not present.
|
static java.lang.Boolean |
optionalBoolean(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Get an optional boolean or null if not present.
|
static net.lenni0451.mcstructs.nbt.tags.CompoundTag |
optionalCompound(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
Deprecated.
Get an optional compound tag or null if not present.
|
static java.lang.Integer |
optionalInt(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
Deprecated.
Get an optional int or null if not present.
|
static java.lang.Integer |
optionalInt(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Get an optional int or null if not present.
|
static com.google.gson.JsonObject |
optionalObject(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Get an optional json object or null if not present.
|
static java.lang.String |
optionalString(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
Deprecated.
Get an optional string or null if not present.
|
static java.lang.String |
optionalString(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Get an optional string or null if not present.
|
static boolean |
requiredBoolean(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
Deprecated.
Get a required boolean or throw an exception if not present.
|
static boolean |
requiredBoolean(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Get a required boolean or throw an exception if not present.
|
static net.lenni0451.mcstructs.nbt.tags.CompoundTag |
requiredCompound(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
Deprecated.
Get a required compound tag or throw an exception if not present.
|
static int |
requiredInt(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
Deprecated.
Get a required int or throw an exception if not present.
|
static int |
requiredInt(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Get a required int or throw an exception if not present.
|
static com.google.gson.JsonObject |
requiredObject(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Get a required json object or throw an exception if not present.
|
static java.lang.String |
requiredString(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
Deprecated.
Get a required string or throw an exception if not present.
|
static java.lang.String |
requiredString(com.google.gson.JsonObject obj,
java.lang.String name)
Deprecated.
Get a required string or throw an exception if not present.
|
public static boolean isString(@Nullable
com.google.gson.JsonElement element)
element - The element to checkpublic static boolean isNumber(@Nullable
com.google.gson.JsonElement element)
element - The element to checkpublic static boolean isObject(@Nullable
com.google.gson.JsonElement element)
element - The element to checkpublic static boolean containsString(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to checkname - The name of the booleanpublic static boolean containsArray(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to checkname - The name of the arraypublic static boolean containsObject(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to checkname - The name of the object@Nullable
public static java.lang.Boolean optionalBoolean(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
tag - The tag to get the boolean fromname - The name of the boolean@Nullable
public static java.lang.Boolean optionalBoolean(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to get the boolean fromname - The name of the boolean@Nullable
public static java.lang.Integer optionalInt(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
tag - The tag to get the int fromname - The name of the int@Nullable
public static java.lang.Integer optionalInt(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to get the int fromname - The name of the int@Nullable
public static java.lang.String optionalString(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
tag - The tag to get the string fromname - The name of the string@Nullable
public static java.lang.String optionalString(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to get the string fromname - The name of the string@Nullable
public static net.lenni0451.mcstructs.nbt.tags.CompoundTag optionalCompound(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
tag - The tag to get the compound fromname - The name of the compound@Nullable
public static com.google.gson.JsonObject optionalObject(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to get the object fromname - The name of the objectpublic static boolean requiredBoolean(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
tag - The tag to get the boolean fromname - The name of the booleanjava.lang.IllegalArgumentException - If the boolean is not presentpublic static boolean requiredBoolean(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to get the boolean fromname - The name of the booleanpublic static int requiredInt(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
tag - The tag to get the int fromname - The name of the intpublic static int requiredInt(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to get the int fromname - The name of the intpublic static java.lang.String requiredString(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
tag - The tag to get the string fromname - The name of the stringpublic static java.lang.String requiredString(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to get the string fromname - The name of the stringpublic static net.lenni0451.mcstructs.nbt.tags.CompoundTag requiredCompound(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag,
java.lang.String name)
tag - The tag to get the compound fromname - The name of the compoundpublic static com.google.gson.JsonObject requiredObject(com.google.gson.JsonObject obj,
java.lang.String name)
obj - The object to get the object fromname - The name of the object