Package redempt.redlib.config.conversion
Interface TypeConverter<T>
- Type Parameters:
T
- The type
- All Known Subinterfaces:
StringConverter<T>
public interface TypeConverter<T>
An interface which converts data in config for a given type
-
Method Summary
Modifier and TypeMethodDescriptionloadFrom
(DataHolder section, String path, T currentValue) Attemps to load the object from configvoid
saveTo
(T t, DataHolder section, String path) Attemps to save the object to configdefault void
saveTo
(T t, DataHolder section, String path, boolean overwrite) Attemps to save the object to config
-
Method Details
-
loadFrom
Attemps to load the object from config- Parameters:
section
- The ConfigurationSection to load frompath
- The path to the data in the ConfigurationSectioncurrentValue
- The current value, used for collections and maps- Returns:
- The loaded object
-
saveTo
Attemps to save the object to config- Parameters:
t
- The object to savesection
- The ConfigurationSection to save topath
- The path to the data that should be saved in the ConfigurationSection
-
saveTo
Attemps to save the object to config- Parameters:
t
- The object to savesection
- The ConfigurationSection to save topath
- The path to the data that should be saved in the ConfigurationSectionoverwrite
- Whether to overwrite existing data
-