public interface PluginFile
| Modifier and Type | Method and Description |
|---|---|
default Object |
get()
Gets the current object in memory
|
default FileDataType |
getConfig()
Returns the relevant
FileDataType for this file. |
DataHolder<? extends FileDataType> |
getData()
Returns the relevant
DataHolder for this file, which provides
thread-safety for the FileDataType object initialization |
Object |
getDefault()
Returns the default value of the key
|
static File |
getFileLocation(Class<? extends PluginFile> clazz)
Returns the save location for passed
PluginFile argument |
String |
getPath()
The
FileDataType path to store this value in |
default <T extends FileDataType> |
init(Class<T> clazz)
Loads the
PluginFile values from the configuration file. |
default void |
save()
Saves the current file data from memory
|
default void |
save(File file)
Saves the current file data from memory to a specific
File |
static File getFileLocation(Class<? extends PluginFile> clazz)
PluginFile argumentclazz - An implementing class with the PluginClass and
RelativePath annotationsFile pointing to the location containing saved values
for this configuration typeString getPath()
FileDataType path to store this value inObject getDefault()
default FileDataType getConfig()
FileDataType for this file.FileDataType of this Configdefault Object get()
DataHolder<? extends FileDataType> getData()
DataHolder for this file, which provides
thread-safety for the FileDataType object initializationDataHolder for this PluginFiledefault <T extends FileDataType> T init(Class<T> clazz)
PluginFile values from the configuration file.
Safe to use for reloadingT - The type of FileDataType to returnclazz - The Class of the returned FileDataTypeFileDataType for all the file infodefault void save()
throws IOException
IOException - Failed to save to the filedefault void save(File file) throws IOException
Filefile - The file to save toIOException - Failed to save to the fileCopyright © 2015. All rights reserved.