Package net.minecraft.util
Class GsonHelper
java.lang.Object
net.minecraft.util.GsonHelper
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic BigDecimalconvertToBigDecimal(com.google.gson.JsonElement p_144779_, String p_144780_) static BigIntegerconvertToBigInteger(com.google.gson.JsonElement p_144782_, String p_144783_) static booleanconvertToBoolean(com.google.gson.JsonElement p_13878_, String p_13879_) static byteconvertToByte(com.google.gson.JsonElement p_13904_, String p_13905_) static charconvertToCharacter(com.google.gson.JsonElement p_144776_, String p_144777_) static doubleconvertToDouble(com.google.gson.JsonElement p_144770_, String p_144771_) static floatconvertToFloat(com.google.gson.JsonElement p_13889_, String p_13890_) static intconvertToInt(com.google.gson.JsonElement p_13898_, String p_13899_) convertToItem(com.google.gson.JsonElement p_13875_, String p_13876_) static com.google.gson.JsonArrayconvertToJsonArray(com.google.gson.JsonElement p_13925_, String p_13926_) static com.google.gson.JsonObjectconvertToJsonObject(com.google.gson.JsonElement p_13919_, String p_13920_) static longconvertToLong(com.google.gson.JsonElement p_13892_, String p_13893_) static <T> TconvertToObject(com.google.gson.JsonElement p_13809_, String p_13810_, com.google.gson.JsonDeserializationContext p_13811_, Class<? extends T> p_13812_) static shortconvertToShort(com.google.gson.JsonElement p_144788_, String p_144789_) static StringconvertToString(com.google.gson.JsonElement p_13806_, String p_13807_) static <T> TfromJson(com.google.gson.Gson p_13768_, Reader p_13769_, com.google.gson.reflect.TypeToken<T> p_13770_) static <T> TfromJson(com.google.gson.Gson p_263499_, Reader p_263527_, com.google.gson.reflect.TypeToken<T> p_263525_, boolean p_263507_) static <T> Tstatic <T> Tstatic <T> Tstatic <T> Tstatic <T> TfromNullableJson(com.google.gson.Gson p_13772_, Reader p_13773_, com.google.gson.reflect.TypeToken<T> p_13774_, boolean p_13775_) static <T> TfromNullableJson(com.google.gson.Gson p_13781_, Reader p_13782_, Class<T> p_13783_, boolean p_13784_) static <T> TfromNullableJson(com.google.gson.Gson p_13786_, String p_13787_, com.google.gson.reflect.TypeToken<T> p_13788_) static <T> TfromNullableJson(com.google.gson.Gson p_13790_, String p_13791_, com.google.gson.reflect.TypeToken<T> p_13792_, boolean p_13793_) static <T> TfromNullableJson(com.google.gson.Gson p_13799_, String p_13800_, Class<T> p_13801_, boolean p_13802_) static BigDecimalgetAsBigDecimal(com.google.gson.JsonObject p_144797_, String p_144798_) static BigDecimalgetAsBigDecimal(com.google.gson.JsonObject p_144751_, String p_144752_, BigDecimal p_144753_) static BigIntegergetAsBigInteger(com.google.gson.JsonObject p_144800_, String p_144801_) static BigIntegergetAsBigInteger(com.google.gson.JsonObject p_144755_, String p_144756_, BigInteger p_144757_) static booleangetAsBoolean(com.google.gson.JsonObject p_13913_, String p_13914_) static booleangetAsBoolean(com.google.gson.JsonObject p_13856_, String p_13857_, boolean p_13858_) static bytestatic bytestatic chargetAsCharacter(com.google.gson.JsonObject p_144794_, String p_144795_) static chargetAsCharacter(com.google.gson.JsonObject p_144739_, String p_144740_, char p_144741_) static doublegetAsDouble(com.google.gson.JsonObject p_144785_, String p_144786_) static doublegetAsDouble(com.google.gson.JsonObject p_144743_, String p_144744_, double p_144745_) static floatgetAsFloat(com.google.gson.JsonObject p_13916_, String p_13917_) static floatgetAsFloat(com.google.gson.JsonObject p_13821_, String p_13822_, float p_13823_) static intstatic intstatic com.google.gson.JsonArraygetAsJsonArray(com.google.gson.JsonObject p_13934_, String p_13935_) static com.google.gson.JsonArraygetAsJsonArray(com.google.gson.JsonObject p_13833_, String p_13834_, com.google.gson.JsonArray p_13835_) static com.google.gson.JsonObjectgetAsJsonObject(com.google.gson.JsonObject p_13931_, String p_13932_) static com.google.gson.JsonObjectgetAsJsonObject(com.google.gson.JsonObject p_13842_, String p_13843_, com.google.gson.JsonObject p_13844_) static longstatic longstatic <T> TgetAsObject(com.google.gson.JsonObject p_13837_, String p_13838_, com.google.gson.JsonDeserializationContext p_13839_, Class<? extends T> p_13840_) static <T> TgetAsObject(com.google.gson.JsonObject p_13846_, String p_13847_, T p_13848_, com.google.gson.JsonDeserializationContext p_13849_, Class<? extends T> p_13850_) static shortgetAsShort(com.google.gson.JsonObject p_144803_, String p_144804_) static shortgetAsShort(com.google.gson.JsonObject p_144759_, String p_144760_, short p_144761_) static StringgetAsString(com.google.gson.JsonObject p_13907_, String p_13908_) static StringgetAsString(com.google.gson.JsonObject p_13852_, String p_13853_, String p_13854_) static com.google.gson.JsonElementgetNonNull(com.google.gson.JsonObject p_289782_, String p_289789_) static StringgetType(com.google.gson.JsonElement p_13884_) static booleanisArrayNode(com.google.gson.JsonObject p_13886_, String p_13887_) static booleanisBooleanValue(com.google.gson.JsonElement p_144768_) static booleanisBooleanValue(com.google.gson.JsonObject p_13881_, String p_13882_) static booleanisNumberValue(com.google.gson.JsonElement p_13873_) static booleanisNumberValue(com.google.gson.JsonObject p_144763_, String p_144764_) static booleanisObjectNode(com.google.gson.JsonObject p_144773_, String p_144774_) static booleanisStringValue(com.google.gson.JsonElement p_13804_) static booleanisStringValue(com.google.gson.JsonObject p_13814_, String p_13815_) static booleanisValidNode(com.google.gson.JsonObject p_13901_, String p_13902_) static booleanisValidPrimitive(com.google.gson.JsonObject p_13895_, String p_13896_) static com.google.gson.JsonObjectstatic com.google.gson.JsonObjectstatic com.google.gson.JsonObjectstatic com.google.gson.JsonObjectstatic com.google.gson.JsonArrayparseArray(Reader p_144766_) static com.google.gson.JsonArrayparseArray(String p_216215_) private static Collection<Map.Entry<String,com.google.gson.JsonElement>> sortByKeyIfNeeded(Collection<Map.Entry<String, com.google.gson.JsonElement>> p_216212_, Comparator<String> p_216213_) static StringtoStableString(com.google.gson.JsonElement p_216217_) static voidwriteValue(com.google.gson.stream.JsonWriter p_216208_, com.google.gson.JsonElement p_216209_, Comparator<String> p_216210_) 
- 
Field Details- 
GSONprivate static final com.google.gson.Gson GSON
 
- 
- 
Constructor Details- 
GsonHelperpublic GsonHelper()
 
- 
- 
Method Details- 
isStringValue
- 
isStringValuepublic static boolean isStringValue(com.google.gson.JsonElement p_13804_) 
- 
isNumberValue
- 
isNumberValuepublic static boolean isNumberValue(com.google.gson.JsonElement p_13873_) 
- 
isBooleanValue
- 
isBooleanValuepublic static boolean isBooleanValue(com.google.gson.JsonElement p_144768_) 
- 
isArrayNode
- 
isObjectNode
- 
isValidPrimitive
- 
isValidNode
- 
getNonNullpublic static com.google.gson.JsonElement getNonNull(com.google.gson.JsonObject p_289782_, String p_289789_) 
- 
convertToString
- 
getAsString
- 
getAsString
- 
convertToItem
- 
getAsItem
- 
getAsItem
- 
convertToBoolean
- 
getAsBoolean
- 
getAsBooleanpublic static boolean getAsBoolean(com.google.gson.JsonObject p_13856_, String p_13857_, boolean p_13858_) 
- 
convertToDouble
- 
getAsDouble
- 
getAsDoublepublic static double getAsDouble(com.google.gson.JsonObject p_144743_, String p_144744_, double p_144745_) 
- 
convertToFloat
- 
getAsFloat
- 
getAsFloatpublic static float getAsFloat(com.google.gson.JsonObject p_13821_, String p_13822_, float p_13823_) 
- 
convertToLong
- 
getAsLong
- 
getAsLong
- 
convertToInt
- 
getAsInt
- 
getAsInt
- 
convertToByte
- 
getAsByte
- 
getAsByte
- 
convertToCharacter
- 
getAsCharacter
- 
getAsCharacterpublic static char getAsCharacter(com.google.gson.JsonObject p_144739_, String p_144740_, char p_144741_) 
- 
convertToBigDecimalpublic static BigDecimal convertToBigDecimal(com.google.gson.JsonElement p_144779_, String p_144780_) 
- 
getAsBigDecimal
- 
getAsBigDecimalpublic static BigDecimal getAsBigDecimal(com.google.gson.JsonObject p_144751_, String p_144752_, BigDecimal p_144753_) 
- 
convertToBigIntegerpublic static BigInteger convertToBigInteger(com.google.gson.JsonElement p_144782_, String p_144783_) 
- 
getAsBigInteger
- 
getAsBigIntegerpublic static BigInteger getAsBigInteger(com.google.gson.JsonObject p_144755_, String p_144756_, BigInteger p_144757_) 
- 
convertToShort
- 
getAsShort
- 
getAsShortpublic static short getAsShort(com.google.gson.JsonObject p_144759_, String p_144760_, short p_144761_) 
- 
convertToJsonObjectpublic static com.google.gson.JsonObject convertToJsonObject(com.google.gson.JsonElement p_13919_, String p_13920_) 
- 
getAsJsonObjectpublic static com.google.gson.JsonObject getAsJsonObject(com.google.gson.JsonObject p_13931_, String p_13932_) 
- 
getAsJsonObject@Nullable @Contract("_,_,!null->!null;_,_,null->_") public static com.google.gson.JsonObject getAsJsonObject(com.google.gson.JsonObject p_13842_, String p_13843_, @Nullable com.google.gson.JsonObject p_13844_) 
- 
convertToJsonArraypublic static com.google.gson.JsonArray convertToJsonArray(com.google.gson.JsonElement p_13925_, String p_13926_) 
- 
getAsJsonArraypublic static com.google.gson.JsonArray getAsJsonArray(com.google.gson.JsonObject p_13934_, String p_13935_) 
- 
getAsJsonArray@Nullable @Contract("_,_,!null->!null;_,_,null->_") public static com.google.gson.JsonArray getAsJsonArray(com.google.gson.JsonObject p_13833_, String p_13834_, @Nullable com.google.gson.JsonArray p_13835_) 
- 
convertToObject
- 
getAsObject
- 
getAsObject
- 
getType
- 
fromNullableJson
- 
fromJson
- 
fromNullableJson@Nullable public static <T> T fromNullableJson(com.google.gson.Gson p_13772_, Reader p_13773_, com.google.gson.reflect.TypeToken<T> p_13774_, boolean p_13775_) 
- 
fromJsonpublic static <T> T fromJson(com.google.gson.Gson p_263499_, Reader p_263527_, com.google.gson.reflect.TypeToken<T> p_263525_, boolean p_263507_) 
- 
fromNullableJson@Nullable public static <T> T fromNullableJson(com.google.gson.Gson p_13790_, String p_13791_, com.google.gson.reflect.TypeToken<T> p_13792_, boolean p_13793_) 
- 
fromJson
- 
fromNullableJson
- 
fromJsonpublic static <T> T fromJson(com.google.gson.Gson p_13768_, Reader p_13769_, com.google.gson.reflect.TypeToken<T> p_13770_) 
- 
fromNullableJson@Nullable public static <T> T fromNullableJson(com.google.gson.Gson p_13786_, String p_13787_, com.google.gson.reflect.TypeToken<T> p_13788_) 
- 
fromJson
- 
fromJson
- 
parse
- 
parse
- 
parse
- 
parse
- 
parseArray
- 
parseArray
- 
toStableString
- 
writeValuepublic static void writeValue(com.google.gson.stream.JsonWriter p_216208_, @Nullable com.google.gson.JsonElement p_216209_, @Nullable Comparator<String> p_216210_) throws IOException - Throws:
- IOException
 
- 
sortByKeyIfNeededprivate static Collection<Map.Entry<String,com.google.gson.JsonElement>> sortByKeyIfNeeded(Collection<Map.Entry<String, com.google.gson.JsonElement>> p_216212_, @Nullable Comparator<String> p_216213_) 
 
-