forked from virt-mirrors/Sit
add update file method to template and comment
This commit is contained in:
parent
82d999c4c5
commit
33271c4aea
3 changed files with 20 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue