public interface ISection extends IBasicSection
| Modifier and Type | Method and Description |
|---|---|
void |
addCommentsAbove(String path,
boolean belowExistingComments,
String... comments)
Adds the given comments above the Entry at the given path.
|
void |
addCommentsBelow(String path,
boolean belowExistingComments,
String... comments)
Adds the given comments below the Entry at the given path.
|
void |
addEntry(Line line) |
boolean |
contains(String path)
Returns if this section contains a list or single value for the given path.
|
Line |
get(String path)
Gets the line with the given path.
Returns null if no line with the given path exists. |
List<Line> |
getEntries() |
List<Line> |
getEntries(String path) |
Set<String> |
getKeys(boolean deep)
Gets a set containing all keys in this section.
If deep is set to true, then this will contain all the keys within any child Sections (and their children, etc). These will be in a valid path notation for you to use. If deep is set to false, then this will contain only the keys of any direct children, and not their own children. |
Set<String> |
getKeys(String path,
boolean deep)
Gets a set containing all keys that start with the given path in this section.
If deep is set to true, then this will contain all the keys within any child Sections (and their children, etc). These will be in a valid path notation for you to use. If deep is set to false, then this will contain only the keys of any direct children, and not their own children. |
String |
getName()
Returns the name of this Section.
|
ISection |
getParent() |
String |
getPath()
Returns the path of this Section, relative to the main config.
|
ISection |
getSection(String path)
Gets the requested
Section by path.Returns an empty section if it didn't exist. |
boolean |
remove(String path)
Removes a Single value, List or Section from the config.
|
boolean |
remove(String path,
boolean renew)
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 |
removeEntry(Line line) |
void |
renew()
|
boolean |
saveConfig() |
boolean |
set(String path,
boolean renew,
Object value)
Sets the value of the item at the given path to the given value.
If value is null, the entry is removed.NOTE: Calling this method WILL affect the actual config, but the changes may or may not be reflected in this IConfigSection. (Removals and Insertions will not affect SectionSnapshots, but will affect the config.) |
boolean |
setList(String path,
boolean removeComments,
boolean renew,
Iterable<?> value)
Sets the entry at the specified path to a list with the given value.
If this path defines an already existing list entry, it is changed. If this path defines an already existing single entry, it will be changed into a list. If this path defines a non existant entry, it and required sections are created and inserted at the right position in the config. |
boolean |
setList(String path,
boolean removeComments,
boolean renew,
Object... values)
Converts the given values into a list and passes it to
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) |
getBoolean, getBoolean, getBooleanList, getByte, getByte, getByteList, getChar, getChar, getCharacterList, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInt, getInt, getIntegerList, getLong, getLong, getLongList, getMixedList, getObject, getObject, getShort, getShort, getShortList, getString, getString, getStringList, getT, getT, getTList, isBoolean, isByte, isChar, isDouble, isFloat, isInt, isLong, isShort, isString, isTISection getParent()
ISection getSection(String path)
Section by path.path - - Path of the Section to get.SectionIllegalArgumentException - if path is null or ends with a dot.Set<String> getKeys(boolean deep)
deep - - Whether or not to get a deep list, as opposed to a shallow list.Set<String> getKeys(String path, boolean deep)
path - - The path the key has to start with to be included in the returned set.deep - - Whether or not to get a deep list, as opposed to a shallow list.IllegalArgumentException - if path is null or ends with a dot.String getPath()
String getName()
Line get(String path)
null if no line with the given path exists.path - - The path of the Line to get.null if it doesn't exist.boolean contains(String path)
path - - The path to check.void addCommentsAbove(String path, boolean belowExistingComments, String... comments)
path - - The path of the entry to add the comments above. If path is empty, comments will be added at the top.belowExistingComments - - Should the given comments be added below existing ones?comments - - The comments to addIllegalArgumentException - if comments is empty.IllegalArgumentException - if path is null or ends with a dot.void addCommentsBelow(String path, boolean belowExistingComments, String... comments)
path - - The path of the entry to add the comments below. If path is empty, comments will be added at the top.belowExistingComments - - Should the given comments be added below existing ones?comments - - The comments to addIllegalArgumentException - if comments is empty.IllegalArgumentException - if path is null or ends with a dot.boolean remove(String path)
remove(String, true) for more information.boolean remove(String path, boolean renew)
renew().
For removals, this can easily be achieved by calling removeBatch(String...)."", this function will CLEAR the config.path - - The path to remove.renew - - If the configuration should be updated to reflect the changes.boolean removeBatch(Iterable<String> paths)
paths - - The paths that should be removed from this config.remove(String)boolean removeBatch(String... paths)
paths - - The paths that should be removed from this config.remove(String)boolean setList(String path, Iterable<?> value)
setList(path, true, true, value)boolean setList(String path, boolean removeComments, Iterable<?> value)
setList(path, removeComments, true, value)boolean setList(String path, boolean removeComments, boolean renew, Iterable<?> value)
path - - The path of the list to set.removeComments - - If the list already exists, should comments in it be removed?renew - - If the map should be renewed (when applicable).value - - The values this list should have.boolean setList(String path, boolean removeComments, boolean renew, Object... values)
setList(String, boolean, boolean, Iterable)boolean set(String path, boolean renew, Object value)
null, the entry is removed.SectionSnapshots, but will affect the config.)path - - The path of the entry you want to change.renew - - If the config should be updated. Only applies for removals and insertions.value - void addEntry(Line line)
boolean removeEntry(Line line)
void renew()
boolean saveConfig()
Copyright © 2014. All rights reserved.