public abstract class ServerConfigList<K,V extends ServerConfigEntry<K>> extends Object
Modifier and Type | Field and Description |
---|---|
private File |
file |
private static Gson |
GSON |
protected static Logger |
LOGGER |
private Map<String,V> |
map |
Constructor and Description |
---|
ServerConfigList(File file) |
Modifier and Type | Method and Description |
---|---|
void |
add(V entry) |
protected boolean |
contains(K k) |
protected abstract ServerConfigEntry<K> |
fromJson(JsonObject json) |
V |
get(K key) |
File |
getFile() |
String[] |
getNames() |
boolean |
isEmpty() |
void |
load() |
void |
remove(K key) |
void |
remove(ServerConfigEntry<K> entry) |
private void |
removeInvalidEntries() |
void |
save() |
protected String |
toString(K profile) |
Collection<V> |
values() |
protected static final Logger LOGGER
private static final Gson GSON
private final File file
private final Map<String,V extends ServerConfigEntry<K>> map
public ServerConfigList(File file)
public File getFile()
public void add(V entry)
public void remove(K key)
public void remove(ServerConfigEntry<K> entry)
public String[] getNames()
public boolean isEmpty()
protected boolean contains(K k)
private void removeInvalidEntries()
protected abstract ServerConfigEntry<K> fromJson(JsonObject json)
public Collection<V> values()
public void save() throws IOException
IOException
public void load() throws IOException
IOException