Class ConfigJson

java.lang.Object
net.ixdarklord.coolcatcore.internal.config.ConfigJson

public final class ConfigJson extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.google.gson.Gson
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    compact(com.google.gson.JsonElement json)
     
    static <T> ValidationResult<T>
    decode(com.mojang.serialization.Codec<T> codec, com.google.gson.JsonElement json)
     
    static <T> com.google.gson.JsonElement
    encode(com.mojang.serialization.Codec<T> codec, T value)
     
    static <T> ValidationResult<T>
    parse(com.mojang.serialization.Codec<T> codec, String text)
     
    static com.google.gson.JsonElement
    Parses JSON leniently: comments, unquoted keys and single quotes are allowed.

    Methods inherited from class Object

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

    • GSON

      public static final com.google.gson.Gson GSON
  • Method Details

    • encode

      public static <T> com.google.gson.JsonElement encode(com.mojang.serialization.Codec<T> codec, T value)
    • decode

      public static <T> ValidationResult<T> decode(com.mojang.serialization.Codec<T> codec, com.google.gson.JsonElement json)
    • parseLenient

      public static com.google.gson.JsonElement parseLenient(String text) throws com.google.gson.JsonParseException
      Parses JSON leniently: comments, unquoted keys and single quotes are allowed.
      Throws:
      com.google.gson.JsonParseException
    • parse

      public static <T> ValidationResult<T> parse(com.mojang.serialization.Codec<T> codec, String text)
    • compact

      public static String compact(com.google.gson.JsonElement json)