2022-02-12 10:13:19 +01:00
|
|
|
package io.gitlab.jfronny.libjf.config.api;
|
|
|
|
|
2022-04-02 22:01:29 +02:00
|
|
|
import io.gitlab.jfronny.gson.JsonObject;
|
2022-02-12 10:13:19 +01:00
|
|
|
import io.gitlab.jfronny.libjf.config.impl.EntryInfo;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
public interface ConfigInstance {
|
|
|
|
static ConfigInstance get(Class<?> configClass) {
|
|
|
|
return ConfigHolder.getInstance().get(configClass);
|
|
|
|
}
|
|
|
|
static ConfigInstance get(String modId) {
|
|
|
|
return ConfigHolder.getInstance().get(modId);
|
|
|
|
}
|
|
|
|
void load();
|
2022-03-31 20:45:10 +02:00
|
|
|
void write();
|
|
|
|
void loadObject(JsonObject source);
|
|
|
|
JsonObject writeObject();
|
2022-02-12 10:13:19 +01:00
|
|
|
void syncToClass();
|
|
|
|
void syncFromClass();
|
|
|
|
String getModId();
|
|
|
|
boolean matchesConfigClass(Class<?> candidate);
|
|
|
|
List<EntryInfo> getEntries();
|
|
|
|
Map<String, Runnable> getPresets();
|
2022-03-30 17:26:41 +02:00
|
|
|
List<String> getReferencedConfigs();
|
2022-03-30 23:08:51 +02:00
|
|
|
Map<String, ConfigInstance> getCategories();
|
|
|
|
String getCategoryPath();
|
2022-02-12 10:13:19 +01:00
|
|
|
}
|