Launcher/LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurable.java

37 lines
778 B
Java
Raw Normal View History

package pro.gravit.launcher.config;
2019-04-03 13:09:53 +03:00
import java.lang.reflect.Type;
import java.nio.file.Path;
2019-06-03 10:58:10 +03:00
import pro.gravit.launcher.LauncherAPI;
public abstract class JsonConfigurable<T> implements JsonConfigurableInterface<T> {
private transient final Type type;
protected transient final Path configPath;
2019-05-15 14:11:22 +03:00
@LauncherAPI
2019-04-03 13:09:53 +03:00
public JsonConfigurable(Type type, Path configPath) {
this.type = type;
this.configPath = configPath;
}
2019-05-15 14:11:22 +03:00
@Override
public Path getPath() {
return configPath;
2019-04-03 13:09:53 +03:00
}
2019-05-15 14:11:22 +03:00
@Override
public Type getType() {
return type;
}
2019-05-15 14:11:22 +03:00
@LauncherAPI
2019-04-03 13:09:53 +03:00
public abstract T getConfig();
2019-05-15 14:11:22 +03:00
@LauncherAPI
2019-04-03 13:09:53 +03:00
public abstract T getDefaultConfig();
2019-05-15 14:11:22 +03:00
@LauncherAPI
2019-04-03 13:09:53 +03:00
public abstract void setConfig(T config);
}