Class GsonHelper

java.lang.Object
net.minecraft.util.GsonHelper
com.minecolonies.core.util.GsonHelper

public class GsonHelper extends net.minecraft.util.GsonHelper
Custom Gson helper class extending GsonHelper with additional methods.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> com.google.gson.JsonArray
    getAsJsonArray(com.google.gson.JsonObject object, String key, Function<T,com.google.gson.JsonArray> defaultValue, T arg)
     
    static com.google.gson.JsonArray
    getAsJsonArray(com.google.gson.JsonObject object, String key, Supplier<com.google.gson.JsonArray> defaultValue)
     
    static net.minecraft.resources.ResourceLocation
    getAsResourceLocation(com.google.gson.JsonObject object, String key)
     
    static net.minecraft.resources.ResourceLocation
    getAsResourceLocation(com.google.gson.JsonObject object, String key, net.minecraft.resources.ResourceLocation defaultValue)
     
    static <T> String
    getAsString(com.google.gson.JsonObject object, String key, Function<T,String> defaultValue, T arg)
     
    static String
    getAsString(com.google.gson.JsonObject object, String key, Supplier<String> defaultValue)
     

    Methods inherited from class net.minecraft.util.GsonHelper

    convertToBigDecimal, convertToBigInteger, convertToBoolean, convertToByte, convertToCharacter, convertToDouble, convertToFloat, convertToInt, convertToItem, convertToJsonArray, convertToJsonObject, convertToLong, convertToObject, convertToShort, convertToString, fromJson, fromJson, fromJson, fromJson, fromJson, fromJson, fromNullableJson, fromNullableJson, fromNullableJson, fromNullableJson, fromNullableJson, getAsBigDecimal, getAsBigDecimal, getAsBigInteger, getAsBigInteger, getAsBoolean, getAsBoolean, getAsByte, getAsByte, getAsCharacter, getAsCharacter, getAsDouble, getAsDouble, getAsFloat, getAsFloat, getAsInt, getAsInt, getAsItem, getAsItem, getAsJsonArray, getAsJsonArray, getAsJsonObject, getAsJsonObject, getAsLong, getAsLong, getAsObject, getAsObject, getAsShort, getAsShort, getAsString, getAsString, getNonNull, getType, isArrayNode, isBooleanValue, isBooleanValue, isNumberValue, isNumberValue, isObjectNode, isStringValue, isStringValue, isValidNode, isValidPrimitive, parse, parse, parse, parse, parseArray, parseArray, toStableString, writeValue

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GsonHelper

      public GsonHelper()
  • Method Details

    • getAsString

      public static <T> String getAsString(com.google.gson.JsonObject object, String key, Function<T,String> defaultValue, T arg)
    • getAsString

      public static String getAsString(com.google.gson.JsonObject object, String key, Supplier<String> defaultValue)
    • getAsResourceLocation

      public static net.minecraft.resources.ResourceLocation getAsResourceLocation(com.google.gson.JsonObject object, String key)
    • getAsResourceLocation

      public static net.minecraft.resources.ResourceLocation getAsResourceLocation(com.google.gson.JsonObject object, String key, net.minecraft.resources.ResourceLocation defaultValue)
    • getAsJsonArray

      public static <T> com.google.gson.JsonArray getAsJsonArray(com.google.gson.JsonObject object, String key, Function<T,com.google.gson.JsonArray> defaultValue, T arg)
    • getAsJsonArray

      public static com.google.gson.JsonArray getAsJsonArray(com.google.gson.JsonObject object, String key, Supplier<com.google.gson.JsonArray> defaultValue)