2019-06-02 05:03:08 +03:00
|
|
|
package pro.gravit.launcher.modules;
|
2019-01-12 03:13:24 +03:00
|
|
|
|
2019-09-20 00:55:57 +03:00
|
|
|
import pro.gravit.launcher.config.SimpleConfigurable;
|
|
|
|
|
2019-01-12 03:13:24 +03:00
|
|
|
import java.nio.file.Path;
|
|
|
|
|
2019-01-18 01:30:55 +03:00
|
|
|
public interface ModulesConfigManager {
|
2019-01-12 03:13:24 +03:00
|
|
|
Path getModuleConfig(String moduleName);
|
2019-01-15 06:35:39 +03:00
|
|
|
|
2019-08-28 11:22:57 +03:00
|
|
|
Path getModuleConfig(String moduleName, String configName);
|
|
|
|
|
2019-01-12 03:13:24 +03:00
|
|
|
Path getModuleConfigDir(String moduleName);
|
2019-09-20 00:55:57 +03:00
|
|
|
|
|
|
|
<T> SimpleConfigurable<T> getConfigurable(Class<T> tClass, Path configPath);
|
|
|
|
|
2019-10-19 19:46:04 +03:00
|
|
|
default <T> SimpleConfigurable<T> getConfigurable(Class<T> tClass, String moduleName) {
|
2019-09-20 00:55:57 +03:00
|
|
|
return getConfigurable(tClass, getModuleConfig(moduleName));
|
|
|
|
}
|
|
|
|
|
2019-10-19 19:46:04 +03:00
|
|
|
default <T> SimpleConfigurable<T> getConfigurable(Class<T> tClass, String moduleName, String configName) {
|
2019-09-20 00:55:57 +03:00
|
|
|
return getConfigurable(tClass, getModuleConfig(moduleName, configName));
|
|
|
|
}
|
2019-01-12 03:13:24 +03:00
|
|
|
}
|