public class UserList<K,V extends UserListEntry<K>>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
UserList.Serializer |
Modifier and Type | Field and Description |
---|---|
protected com.google.gson.Gson |
gson |
private boolean |
lanServer |
protected static org.apache.logging.log4j.Logger |
LOGGER |
private java.io.File |
saveFile |
private static java.lang.reflect.ParameterizedType |
USER_LIST_ENTRY_TYPE |
private java.util.Map<java.lang.String,V> |
values |
Constructor and Description |
---|
UserList(java.io.File saveFile) |
Modifier and Type | Method and Description |
---|---|
void |
addEntry(V entry) |
protected UserListEntry<K> |
createEntry(com.google.gson.JsonObject entryData) |
V |
getEntry(K obj) |
java.lang.String[] |
getKeys() |
protected java.lang.String |
getObjectKey(K obj) |
java.io.File |
getSaveFile() |
protected java.util.Map<java.lang.String,V> |
getValues() |
protected boolean |
hasEntry(K entry) |
boolean |
isEmpty() |
boolean |
isLanServer() |
void |
readSavedFile() |
void |
removeEntry(K entry) |
private void |
removeExpired() |
void |
setLanServer(boolean state) |
void |
writeChanges() |
protected static final org.apache.logging.log4j.Logger LOGGER
protected final com.google.gson.Gson gson
private final java.io.File saveFile
private final java.util.Map<java.lang.String,V extends UserListEntry<K>> values
private boolean lanServer
private static final java.lang.reflect.ParameterizedType USER_LIST_ENTRY_TYPE
public boolean isLanServer()
public void setLanServer(boolean state)
public void addEntry(V entry)
public void removeEntry(K entry)
public java.io.File getSaveFile()
public java.lang.String[] getKeys()
protected java.lang.String getObjectKey(K obj)
protected boolean hasEntry(K entry)
private void removeExpired()
protected UserListEntry<K> createEntry(com.google.gson.JsonObject entryData)
protected java.util.Map<java.lang.String,V> getValues()
public void writeChanges() throws java.io.IOException
java.io.IOException
public boolean isEmpty()
public void readSavedFile() throws java.io.IOException, java.io.FileNotFoundException
java.io.IOException
java.io.FileNotFoundException