public abstract class CSection extends Object implements ISection
| Constructor and Description |
|---|
CSection() |
| Modifier and Type | Method and Description |
|---|---|
abstract Line |
get(String path)
Gets the line with the given path.
Returns null if no line with the given path exists. |
boolean |
getBoolean(String path)
Gets the requested boolean by path.
If the value at the path does not exist or is not a boolean, this will return false. |
boolean |
getBoolean(String path,
boolean def)
Gets the requested boolean by path.
If the value at the path does not exist or is not a boolean, this will return def. |
List<Boolean> |
getBooleanList(String path)
Gets the requested List of Boolean by path.
If the value at the path does not exist or is not a List of Booleans, this will return an empty list. |
byte |
getByte(String path)
Gets the requested byte by path.
If the value at the path does not exist or is not a byte, this will return 0. |
byte |
getByte(String path,
byte def)
Gets the requested byte by path.
If the value at the path does not exist or is not a byte, this will return def. |
List<Byte> |
getByteList(String path)
Gets the requested List of Byte by path.
If the value at the path does not exist or is not a List of Bytes, this will return an empty list. |
char |
getChar(String path)
Gets the requested char by path.
If the value at the path does not exist or is not a char, this will return ' ' (null char). |
char |
getChar(String path,
char def)
Gets the requested char by path.
If the value at the path does not exist or is not a char, this will return def. |
List<Character> |
getCharacterList(String path)
Gets the requested List of Character by path.
If the value at the path does not exist or is not a List of Characters, this will return an empty list. |
double |
getDouble(String path)
Gets the requested double by path.
If the value at the path does not exist or is not a double, this will return 0. |
double |
getDouble(String path,
double def)
Gets the requested double by path.
If the value at the path does not exist or is not a double, this will return def. |
List<Double> |
getDoubleList(String path)
Gets the requested List of Double by path.
If the value at the path does not exist or is not a List of Doubles, this will return an empty list. |
float |
getFloat(String path)
Gets the requested float by path.
If the value at the path does not exist or is not a float, this will return 0. |
float |
getFloat(String path,
float def)
Gets the requested float by path.
If the value at the path does not exist or is not a float, this will return def. |
List<Float> |
getFloatList(String path)
Gets the requested List of Float by path.
If the value at the path does not exist or is not a List of Floats, this will return an empty list. |
int |
getInt(String path)
Gets the requested int by path.
If the value at the path does not exist or is not a int, this will return 0. |
int |
getInt(String path,
int def)
Gets the requested int by path.
If the value at the path does not exist or is not a int, this will return def. |
List<Integer> |
getIntegerList(String path)
Gets the requested List of Integer by path.
If the value at the path does not exist or is not a List of Integers, this will return an empty list. |
long |
getLong(String path)
Gets the requested long by path.
If the value at the path does not exist or is not a long, this will return 0. |
long |
getLong(String path,
long def)
Gets the requested long by path.
If the value at the path does not exist or is not a long, this will return def. |
List<Long> |
getLongList(String path)
Gets the requested List of Long by path.
If the value at the path does not exist or is not a List of Longs, this will return an empty list. |
List<Object> |
getMixedList(String path)
Gets the requested List by path.
If the value at the path does not exist, this will return an empty list. Converts whole numbers into Integers or Longs (whichever fits best) Converts floating point numbers into Doubles Converts true, false, yes and no into their respective Boolean values |
Object |
getObject(String path) |
Object |
getObject(String path,
Object def) |
short |
getShort(String path)
Gets the requested short by path.
If the value at the path does not exist or is not a short, this will return 0. |
short |
getShort(String path,
short def)
Gets the requested short by path.
If the value at the path does not exist or is not a short, this will return def. |
List<Short> |
getShortList(String path)
Gets the requested List of Short by path.
If the value at the path does not exist or is not a List of Shorts, this will return an empty list. |
String |
getString(String path)
Gets the requested String by path.
If the value at the path does not exist, this will return null. |
String |
getString(String path,
String def)
Gets the requested String by path.
If the value at the path does not exist, this will return def. |
List<String> |
getStringList(String path)
Gets the requested List of String by path.
If the value at the path does not exist, this will return an empty list. |
<T> T |
getT(String path,
Class<T> clazz)
Gets an instance of the given class by path.
If the value at the path does not exist or is not an instance of the given class, this will return null. |
<T> T |
getT(String path,
T def,
Class<T> clazz)
Gets an instance of the given class by path.
If the value at the path does not exist or is not an instance of the given class, this will return def. |
<T> List<T> |
getTList(String path,
Class<T> clazz)
Gets the requested List by path.
If the value at the path does not exist or is not a List of T, this will return an empty list. |
boolean |
isBoolean(String path)
Checks if the entry at the given path can be interpreted as a boolean.
|
boolean |
isByte(String path)
Checks if the entry at the given path can be interpreted as a byte.
|
boolean |
isChar(String path)
Checks if the entry at the given path can be interpreted as a char.
|
boolean |
isDouble(String path)
Checks if the entry at the given path can be interpreted as a double.
|
boolean |
isFloat(String path)
Checks if the entry at the given path can be interpreted as a float.
|
boolean |
isInt(String path)
Checks if the entry at the given path can be interpreted as an int.
|
boolean |
isLong(String path)
Checks if the entry at the given path can be interpreted as a long.
|
boolean |
isShort(String path)
Checks if the entry at the given path can be interpreted as a short.
|
boolean |
isString(String path)
Checks if the entry at the given path can be interpreted as a String.
|
<T> boolean |
isT(String path,
Class<T> clazz)
Checks if the entry at the given path can be interpreted as an instance of the given class.
|
boolean |
remove(String path)
Removes a Single value, List or Section from the config.
|
boolean |
removeBatch(Iterable<String> paths)
Removes a batch of entries from the config.
|
boolean |
removeBatch(String... paths)
Removes a batch of entries from the config.
|
boolean |
setList(String path,
boolean removeComments,
boolean renew,
Object... values)
Converts the given values into a list and passes it to
ISection.setList(String, boolean, boolean, Iterable) |
boolean |
setList(String path,
boolean removeComments,
Iterable<?> value)
Shortcut for
setList(path, removeComments, true, value) |
boolean |
setList(String path,
Iterable<?> value)
Shortcut for
setList(path, true, true, value) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCommentsAbove, addCommentsBelow, addEntry, contains, getEntries, getEntries, getKeys, getKeys, getName, getParent, getPath, getSection, remove, removeEntry, renew, saveConfig, set, setListpublic byte getByte(String path)
IBasicSectiongetByte in interface IBasicSectionpath - - Path of the byte to get.public byte getByte(String path, byte def)
IBasicSectiongetByte in interface IBasicSectionpath - - Path of the byte to get.def - - The byte that will be returned if the value does not exist or is not a byte.public boolean isByte(String path)
IBasicSectionisByte in interface IBasicSectionpath - - Path of the entry to check.public short getShort(String path)
IBasicSectiongetShort in interface IBasicSectionpath - - Path of the short to get.public short getShort(String path, short def)
IBasicSectiongetShort in interface IBasicSectionpath - - Path of the short to get.def - - The short that will be returned if the value does not exist or is not a short.public boolean isShort(String path)
IBasicSectionisShort in interface IBasicSectionpath - - Path of the entry to check.public int getInt(String path)
IBasicSectiongetInt in interface IBasicSectionpath - - Path of the int to get.public int getInt(String path, int def)
IBasicSectiongetInt in interface IBasicSectionpath - - Path of the int to get.def - - The int that will be returned if the value does not exist or is not a int.public boolean isInt(String path)
IBasicSectionisInt in interface IBasicSectionpath - - Path of the entry to check.public long getLong(String path)
IBasicSectiongetLong in interface IBasicSectionpath - - Path of the long to get.public long getLong(String path, long def)
IBasicSectiongetLong in interface IBasicSectionpath - - Path of the long to get.def - - The long that will be returned if the value does not exist or is not a long.public boolean isLong(String path)
IBasicSectionisLong in interface IBasicSectionpath - - Path of the entry to check.public float getFloat(String path)
IBasicSectiongetFloat in interface IBasicSectionpath - - Path of the float to get.public float getFloat(String path, float def)
IBasicSectiongetFloat in interface IBasicSectionpath - - Path of the float to get.def - - The float that will be returned if the value does not exist or is not a float.public boolean isFloat(String path)
IBasicSectionisFloat in interface IBasicSectionpath - - Path of the entry to check.public double getDouble(String path)
IBasicSectiongetDouble in interface IBasicSectionpath - - Path of the double to get.public double getDouble(String path, double def)
IBasicSectiongetDouble in interface IBasicSectionpath - - Path of the double to get.def - - The double that will be returned if the value does not exist or is not a double.public boolean isDouble(String path)
IBasicSectionisDouble in interface IBasicSectionpath - - Path of the entry to check.public boolean getBoolean(String path)
IBasicSectiongetBoolean in interface IBasicSectionpath - - Path of the boolean to get.public boolean getBoolean(String path, boolean def)
IBasicSectiongetBoolean in interface IBasicSectionpath - - Path of the boolean to get.def - - The boolean that will be returned if the value does not exist or is not a boolean.public boolean isBoolean(String path)
IBasicSectionisBoolean in interface IBasicSectionpath - - Path of the entry to check.public char getChar(String path)
IBasicSectiongetChar in interface IBasicSectionpath - - Path of the char to get.public char getChar(String path, char def)
IBasicSectiongetChar in interface IBasicSectionpath - - Path of the char to get.def - - The char that will be returned if the value does not exist or is not a char.public boolean isChar(String path)
IBasicSectionisChar in interface IBasicSectionpath - - Path of the entry to check.public String getString(String path)
IBasicSectiongetString in interface IBasicSectionpath - - Path of the String to get.public String getString(String path, String def)
IBasicSectiongetString in interface IBasicSectionpath - - Path of the String to get.def - - The String that will be returned if the value does not exist.public boolean isString(String path)
IBasicSectionisString in interface IBasicSectionpath - - Path of the entry to check.public Object getObject(String path)
getObject in interface IBasicSectionpublic Object getObject(String path, Object def)
getObject in interface IBasicSectionpublic <T> T getT(String path, Class<T> clazz)
IBasicSectiongetT in interface IBasicSectionpath - - Path of the entry to get.clazz - - The class of the type you want to get.public <T> T getT(String path, T def, Class<T> clazz)
IBasicSectiongetT in interface IBasicSectionpath - - Path of the entry to get.def - - The value that will be returned if the value does not exist or is not an instance of the given class.clazz - - The class of the type you want to get.public <T> boolean isT(String path, Class<T> clazz)
IBasicSectionisT in interface IBasicSectionpath - - Path of the entry to check.clazz - - The class of the type you want to check.public List<Byte> getByteList(String path)
IBasicSectiongetByteList in interface IBasicSectionpath - - Path of the List to get.public List<Short> getShortList(String path)
IBasicSectiongetShortList in interface IBasicSectionpath - - Path of the List to get.public List<Integer> getIntegerList(String path)
IBasicSectiongetIntegerList in interface IBasicSectionpath - - Path of the List to get.public List<Long> getLongList(String path)
IBasicSectiongetLongList in interface IBasicSectionpath - - Path of the List to get.public List<Float> getFloatList(String path)
IBasicSectiongetFloatList in interface IBasicSectionpath - - Path of the List to get.public List<Double> getDoubleList(String path)
IBasicSectiongetDoubleList in interface IBasicSectionpath - - Path of the List to get.public List<Boolean> getBooleanList(String path)
IBasicSectiongetBooleanList in interface IBasicSectionpath - - Path of the List to get.public List<Character> getCharacterList(String path)
IBasicSectiongetCharacterList in interface IBasicSectionpath - - Path of the List to get.public List<String> getStringList(String path)
IBasicSectiongetStringList in interface IBasicSectionpath - - Path of the List to get.public List<Object> getMixedList(String path)
IBasicSectiongetMixedList in interface IBasicSectionpath - - Path of the List to get.public <T> List<T> getTList(String path, Class<T> clazz)
IBasicSectiongetTList in interface IBasicSectionpath - - Path of the List to get.clazz - - The class of the type you want to get.public abstract Line get(String path)
ISectionnull if no line with the given path exists.public boolean remove(String path)
ISectionremove(String, true) for more information.public boolean removeBatch(Iterable<String> paths)
ISectionremoveBatch in interface ISectionpaths - - The paths that should be removed from this config.ISection.remove(String)public boolean removeBatch(String... paths)
ISectionremoveBatch in interface ISectionpaths - - The paths that should be removed from this config.ISection.remove(String)public boolean setList(String path, Iterable<?> value)
ISectionsetList(path, true, true, value)public boolean setList(String path, boolean removeComments, Iterable<?> value)
ISectionsetList(path, removeComments, true, value)public boolean setList(String path, boolean removeComments, boolean renew, Object... values)
ISectionISection.setList(String, boolean, boolean, Iterable)setList in interface ISectionISection.setList(String, boolean, boolean, Iterable)Copyright © 2014. All rights reserved.