add update file method to template and comment

This commit is contained in:
Oth3r 2024-12-02 12:55:55 -06:00
commit 33271c4aea
3 changed files with 20 additions and 13 deletions

View file

@ -56,13 +56,24 @@ public interface CustomFile <T extends CustomFile<T>> {
if (file == null) throw new NullPointerException();
// update the instance
updateToNewFile(file);
file.update();
// load the file to the current object
loadFileData(file);
}
@NotNull
Class<T> getFileClass();
void updateToNewFile(T newFile);
/**
* loads the data from the file object into the current object
* @param newFile the file to take the properties from
*/
void loadFileData(T newFile);
/**
* updates the file based on the version number of the current instance
*/
void update();
/**
* logic for the file not existing when loading, defaults to saving