Class AbstractSave
java.lang.Object
com.viaversion.viafabricplus.save.AbstractSave
- Direct Known Subclasses:
AccountsSave, SettingsSave
This class can be used to save data to a file.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPath()voidinit()This method should be called when the file should be initialized.voidpostInit()abstract voidread(com.google.gson.JsonObject object) voidsave()This method should be called when the file should be saved.abstract voidwrite(com.google.gson.JsonObject object)
-
Field Details
-
GSON
public static final com.google.gson.Gson GSON
-
-
Constructor Details
-
AbstractSave
- Parameters:
name- The name of the file.
-
-
Method Details
-
init
public void init()This method should be called when the file should be initialized. It will read the file and call theread(JsonObject)method. -
save
public void save()This method should be called when the file should be saved. -
write
public abstract void write(com.google.gson.JsonObject object) -
read
public abstract void read(com.google.gson.JsonObject object) -
postInit
public void postInit() -
getPath
-