Class JsonTools

java.lang.Object
dev.boze.api.config.JsonTools

public final class JsonTools extends Object
Interface for saving and loading json objects
  • Constructor Details

    • JsonTools

      public JsonTools()
  • Method Details

    • saveObject

      public static boolean saveObject(Addon addon, String fileName, Serializable<?> object)
      Saves an object to a file
      Parameters:
      addon - The addon to save the object for
      fileName - The name of the file to save the object to
      object - The object to save
      Returns:
      If the object was saved successfully
    • loadObject

      public static <T extends Serializable<T>> T loadObject(Addon addon, String fileName, Serializable<T> object)
      Loads to object from a file
      Parameters:
      addon - The addon to load the object for
      fileName - The name of the file to load the object from
      object - The object to load to
      Returns:
      The loaded object, or null if the object failed to load