public class ConfigFile
extends java.lang.Object
Constructor and Description |
---|
ConfigFile(java.lang.String path)
A class for storing human readable data
|
ConfigFile(java.lang.String path,
java.lang.String extension)
A class for storing human readable data
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all of the data saved in the file
|
void |
delete()
Deletes the file
|
boolean |
getBoolean(java.lang.String key)
Gets the value assigned to the key
|
byte |
getByte(java.lang.String key)
Gets the value assigned to the key
|
double |
getDouble(java.lang.String key)
Gets the value assigned to the key
|
float |
getFloat(java.lang.String key)
Gets the value assigned to the key
|
int |
getInt(java.lang.String key)
Gets the value assigned to the key
|
java.util.List<java.lang.String> |
getList(java.lang.String key)
Gets a List assigned to the key
|
long |
getLong(java.lang.String key)
Gets the value assigned to the key
|
short |
getShort(java.lang.String key)
Gets the value assigned to the key
|
java.lang.String |
getString(java.lang.String key)
Gets the value assigned to the key
|
boolean |
isBoolean(java.lang.String key)
Returns whether the value assigned to the key is a boolean
|
boolean |
isByte(java.lang.String key)
Returns whether the value assigned to the key is a byte
|
boolean |
isDouble(java.lang.String key)
Returns whether the value assigned to the key is a double
|
boolean |
isFloat(java.lang.String key)
Returns whether the value assigned to the key is a float
|
boolean |
isInt(java.lang.String key)
Returns whether the value assigned to the key is an integer
|
boolean |
isLong(java.lang.String key)
Returns whether the value assigned to the key is a long
|
boolean |
isShort(java.lang.String key)
Returns whether the value assigned to the key is a short
|
java.util.Set<java.lang.String> |
keySet()
Gets a list of all keys saved in the file
|
void |
remove(java.lang.String key)
Removes the specified line from the file
|
void |
save()
Saves the current data to the file
|
void |
set(java.lang.String key,
java.lang.Object value)
Assigns a value to a key
|
public ConfigFile(java.lang.String path)
path
- The path to the new, or existing file excluding the extensionpublic ConfigFile(java.lang.String path, java.lang.String extension)
path
- The path to the new, or existing fileextension
- The extension of the file excluding the periodpublic void save()
public void set(java.lang.String key, java.lang.Object value)
key
- The keyvalue
- The value assigned to the keypublic void remove(java.lang.String key)
key
- The key to removepublic void clear()
public void delete()
public java.util.Set<java.lang.String> keySet()
public java.lang.String getString(java.lang.String key)
key
- The key in which to get the value frompublic int getInt(java.lang.String key)
key
- The key in which to get the value frompublic double getDouble(java.lang.String key)
key
- The key in which to get the value frompublic float getFloat(java.lang.String key)
key
- The key in which to get the value frompublic long getLong(java.lang.String key)
key
- The key in which to get the value frompublic java.util.List<java.lang.String> getList(java.lang.String key)
key
- The key in which to get the value frompublic boolean getBoolean(java.lang.String key)
key
- The key in which to get the value frompublic byte getByte(java.lang.String key)
key
- The key in which to get the value frompublic short getShort(java.lang.String key)
key
- The key in which to get the value frompublic boolean isInt(java.lang.String key)
key
- The key to get the value frompublic boolean isDouble(java.lang.String key)
key
- The key to get the value frompublic boolean isFloat(java.lang.String key)
key
- The key to get the value frompublic boolean isLong(java.lang.String key)
key
- The key to get the value frompublic boolean isBoolean(java.lang.String key)
key
- The key to get the value frompublic boolean isByte(java.lang.String key)
key
- The key to get the value frompublic boolean isShort(java.lang.String key)
key
- The key to get the value from