public class MemorySection extends Object implements ConfigurationSection
ConfigurationSection that is stored in memory.
Synchronized with the commit on 21-December-2019.| Modifier | Constructor and Description |
|---|---|
protected |
MemorySection()
Creates an empty MemorySection for use as a root
Configuration
section. |
protected |
MemorySection(@NotNull ConfigurationSection parent,
@NotNull String path)
Creates an empty MemorySection with the specified parent and path.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDefault(@NotNull String path,
@Nullable Object value)
Sets the default value in the root at the given path as provided.
|
boolean |
contains(@NotNull String path)
Checks if this
ConfigurationSection contains the given path. |
boolean |
contains(@NotNull String path,
boolean ignoreDefault)
Checks if this
ConfigurationSection contains the given path. |
static @NotNull String |
createPath(@NotNull ConfigurationSection section,
@Nullable String key)
Creates a full path to the given
ConfigurationSection from its
root Configuration. |
static @NotNull String |
createPath(@NotNull ConfigurationSection section,
@Nullable String key,
@Nullable ConfigurationSection relative)
Creates a relative path to the given
ConfigurationSection from
the given relative section. |
@NotNull ConfigurationSection |
createSection(@NotNull String path)
Creates an empty
ConfigurationSection at the specified path. |
@NotNull ConfigurationSection |
createSection(@NotNull String path,
@NotNull Map<?,?> map)
Creates a
ConfigurationSection at the specified path, with
specified values. |
@Nullable Object |
get(@NotNull String path)
Gets the requested Object by path.
|
@Nullable Object |
get(@NotNull String path,
@Nullable Object def)
Gets the requested Object by path, returning a default value if not
found.
|
boolean |
getBoolean(@NotNull String path)
Gets the requested boolean by path.
|
boolean |
getBoolean(@NotNull String path,
boolean def)
Gets the requested boolean by path, returning a default value if not
found.
|
@NotNull List<Boolean> |
getBooleanList(@NotNull String path)
Gets the requested List of Boolean by path.
|
byte |
getByte(@NotNull String path)
Gets the requested byte by path.
|
byte |
getByte(@NotNull String path,
byte def)
Gets the requested byte by path, returning a default value if not found.
|
@NotNull List<Byte> |
getByteList(@NotNull String path)
Gets the requested List of Byte by path.
|
char |
getChar(@NotNull String path)
Gets the requested char by path.
|
char |
getChar(@NotNull String path,
char def)
Gets the requested char by path, returning a default value if not
found.
|
@NotNull List<Character> |
getCharList(@NotNull String path)
Gets the requested List of Character by path.
|
@Nullable ConfigurationSection |
getConfigurationSection(@NotNull String path)
Gets the requested ConfigurationSection by path.
|
@NotNull String |
getCurrentPath()
Gets the path of this
ConfigurationSection from its root Configuration |
protected @Nullable Object |
getDefault(@NotNull String path)
Gets the default
Object for the given path. |
@Nullable ConfigurationSection |
getDefaultSection()
Gets the equivalent
ConfigurationSection from the default
Configuration defined in ConfigurationSection.getRoot(). |
double |
getDouble(@NotNull String path)
Gets the requested double by path.
|
double |
getDouble(@NotNull String path,
double def)
Gets the requested double by path, returning a default value if not
found.
|
@NotNull List<Double> |
getDoubleList(@NotNull String path)
Gets the requested List of Double by path.
|
float |
getFloat(@NotNull String path)
Gets the requested float by path.
|
float |
getFloat(@NotNull String path,
float def)
Gets the requested float by path, returning a default value if not
found.
|
@NotNull List<Float> |
getFloatList(@NotNull String path)
Gets the requested List of Float by path.
|
int |
getInt(@NotNull String path)
Gets the requested int by path.
|
int |
getInt(@NotNull String path,
int def)
Gets the requested int by path, returning a default value if not found.
|
@NotNull List<Integer> |
getIntList(@NotNull String path)
Gets the requested List of Integer by path.
|
@NotNull Set<String> |
getKeys(boolean deep)
Gets a set containing all keys in this section.
|
@Nullable List<?> |
getList(@NotNull String path)
Gets the requested List by path.
|
@Nullable List<?> |
getList(@NotNull String path,
@Nullable List<?> def)
Gets the requested List by path, returning a default value if not
found.
|
long |
getLong(@NotNull String path)
Gets the requested long by path.
|
long |
getLong(@NotNull String path,
long def)
Gets the requested long by path, returning a default value if not
found.
|
@NotNull List<Long> |
getLongList(@NotNull String path)
Gets the requested List of Long by path.
|
@NotNull List<Map<?,?>> |
getMapList(@NotNull String path)
Gets the requested List of Maps by path.
|
@NotNull String |
getName()
Gets the name of this individual
ConfigurationSection, in the
path. |
<T> T |
getObject(@NotNull String path,
@NotNull Class<T> clazz)
Gets the requested object at the given path.
|
<T> T |
getObject(@NotNull String path,
@NotNull Class<T> clazz,
T def)
Gets the requested object at the given path, returning a default value if
not found
If the Object does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration. |
@Nullable ConfigurationSection |
getParent()
Gets the parent
ConfigurationSection that directly contains
this ConfigurationSection. |
@Nullable Configuration |
getRoot()
Gets the root
Configuration that contains this ConfigurationSection |
<T extends ConfigurationSerializable> |
getSerializable(@NotNull String path,
@NotNull Class<T> clazz)
Gets the requested
ConfigurationSerializable object at the given
path. |
<T extends ConfigurationSerializable> |
getSerializable(@NotNull String path,
@NotNull Class<T> clazz,
T def)
Gets the requested
ConfigurationSerializable object at the given
path, returning a default value if not found
If the Object does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration. |
short |
getShort(@NotNull String path)
Gets the requested short by path.
|
short |
getShort(@NotNull String path,
short def)
Gets the requested short by path, returning a default value if not found.
|
@NotNull List<Short> |
getShortList(@NotNull String path)
Gets the requested List of Short by path.
|
@Nullable String |
getString(@NotNull String path)
Gets the requested String by path.
|
@Nullable String |
getString(@NotNull String path,
@Nullable String def)
Gets the requested String by path, returning a default value if not
found.
|
@NotNull List<String> |
getStringList(@NotNull String path)
Gets the requested List of String by path.
|
@NotNull Map<String,Object> |
getValues(boolean deep)
Gets a Map containing all keys and their values for this section.
|
boolean |
isBoolean(@NotNull String path)
Checks if the specified path is a boolean.
|
boolean |
isByte(@NotNull String path)
Checks if the specified path is an byte.
|
boolean |
isChar(@NotNull String path)
Checks if the specified path is a char.
|
boolean |
isConfigurationSection(@NotNull String path)
Checks if the specified path is a ConfigurationSection.
|
boolean |
isDouble(@NotNull String path)
Checks if the specified path is a double.
|
boolean |
isFloat(@NotNull String path)
Checks if the specified path is a float.
|
boolean |
isInt(@NotNull String path)
Checks if the specified path is an int.
|
boolean |
isList(@NotNull String path)
Checks if the specified path is a List.
|
boolean |
isLong(@NotNull String path)
Checks if the specified path is a long.
|
boolean |
isSet(@NotNull String path)
Checks if this
ConfigurationSection has a value set for the
given path. |
boolean |
isShort(@NotNull String path)
Checks if the specified path is an short.
|
boolean |
isString(@NotNull String path)
Checks if the specified path is a String.
|
protected void |
mapChildrenKeys(@NotNull Set<String> output,
@NotNull ConfigurationSection section,
boolean deep)
Maps the keys of the given child
ConfigurationSection. |
protected void |
mapChildrenValues(@NotNull Map<String,Object> output,
@NotNull ConfigurationSection section,
boolean deep)
Maps the key-value pairs of the given child
ConfigurationSection. |
void |
set(@NotNull String path,
@Nullable Object value)
Sets the specified path to the given value.
|
String |
toString()
Creates a
String representation of this MemorySection. |
protected MemorySection()
Configuration
section.
Note that calling this without being yourself a Configuration
will throw an exception!
IllegalStateException - Thrown if this is not a Configuration root.protected MemorySection(@NotNull
@NotNull ConfigurationSection parent,
@NotNull
@NotNull String path)
parent - Parent section that contains this own section.path - Path that you may access this section from via the root
Configuration.IllegalArgumentException - Thrown is parent or path is null, or
if parent contains no root Configuration.@NotNull public @NotNull Set<String> getKeys(boolean deep)
If deep is set to true, then this will contain all the keys within any
child ConfigurationSections (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.
getKeys in interface ConfigurationSectiondeep - Whether or not to get a deep list, as opposed to a shallow
list.@NotNull public @NotNull Map<String,Object> getValues(boolean deep)
If deep is set to true, then this will contain all the keys and values
within any child ConfigurationSections (and their children,
etc). These keys will be in a valid path notation for you to use.
If deep is set to false, then this will contain only the keys and values of any direct children, and not their own children.
getValues in interface ConfigurationSectiondeep - Whether or not to get a deep list, as opposed to a shallow
list.@NotNull public @NotNull String getCurrentPath()
ConfigurationSection from its root Configuration
For any Configuration themselves, this will return an empty
string.
If the section is no longer contained within its root for any reason, such as being replaced with a different value, this may return null.
To retrieve the single name of this section, that is, the final part of
the path returned by this method, you may use ConfigurationSection.getName().
getCurrentPath in interface ConfigurationSection@NotNull public @NotNull String getName()
ConfigurationSection, in the
path.
This will always be the final part of ConfigurationSection.getCurrentPath(), unless
the section is orphaned.
getName in interface ConfigurationSection@Nullable public @Nullable Configuration getRoot()
Configuration that contains this ConfigurationSection
For any Configuration themselves, this will return its own
object.
If the section is no longer contained within its root for any reason, such as being replaced with a different value, this may return null.
getRoot in interface ConfigurationSection@Nullable public @Nullable ConfigurationSection getParent()
ConfigurationSection that directly contains
this ConfigurationSection.
For any Configuration themselves, this will return null.
If the section is no longer contained within its parent for any reason, such as being replaced with a different value, this may return null.
getParent in interface ConfigurationSection@Nullable public @Nullable ConfigurationSection getDefaultSection()
ConfigurationSection from the default
Configuration defined in ConfigurationSection.getRoot().
If the root contains no defaults, or the defaults doesn't contain a
value for this path, or the value at this path is not a ConfigurationSection then this will return null.
getDefaultSection in interface ConfigurationSectionpublic void addDefault(@NotNull
@NotNull String path,
@Nullable
@Nullable Object value)
If no source Configuration was provided as a default
collection, then a new MemoryConfiguration will be created to
hold the new default value.
If value is null, the value will be removed from the default Configuration source.
If the value as returned by ConfigurationSection.getDefaultSection() is null, then
this will create a new section at the path, replacing anything that may
have existed there previously.
addDefault in interface ConfigurationSectionpath - Path of the value to set.value - Value to set the default to.@NotNull public @NotNull ConfigurationSection createSection(@NotNull @NotNull String path)
ConfigurationSection at the specified path.
Any value that was previously set at this path will be overwritten. If
the previous value was itself a ConfigurationSection, it will
be orphaned.
createSection in interface ConfigurationSectionpath - Path to create the section at.@NotNull public @NotNull ConfigurationSection createSection(@NotNull @NotNull String path, @NotNull @NotNull Map<?,?> map)
ConfigurationSection at the specified path, with
specified values.
Any value that was previously set at this path will be overwritten. If
the previous value was itself a ConfigurationSection, it will
be orphaned.
createSection in interface ConfigurationSectionpath - Path to create the section at.map - The values to used.public boolean isSet(@NotNull
@NotNull String path)
ConfigurationSection has a value set for the
given path.
If the value for the requested path does not exist but a default value has been specified, this will still return false.
isSet in interface ConfigurationSectionpath - Path to check for existence.public void set(@NotNull
@NotNull String path,
@Nullable
@Nullable Object value)
If value is null, the entry will be removed. Any existing entry will be replaced, regardless of what the new value is.
Some implementations may have limitations on what you may store. See
their individual javadocs for details. No implementations should allow
you to store Configurations or ConfigurationSections,
please use ConfigurationSection.createSection(java.lang.String) for that.
set in interface ConfigurationSectionpath - Path of the object to set.value - New value to set the path to.public boolean contains(@NotNull
@NotNull String path)
ConfigurationSection contains the given path.
If the value for the requested path does not exist but a default value has been specified, this will return true.
contains in interface ConfigurationSectionpath - Path to check for existence.public boolean contains(@NotNull
@NotNull String path,
boolean ignoreDefault)
ConfigurationSection contains the given path.
If the value for the requested path does not exist, the boolean parameter of true has been specified, a default value for the path exists, this will return true.
If a boolean parameter of false has been specified, true will only be returned if there is a set value for the specified path.
contains in interface ConfigurationSectionpath - Path to check for existence.ignoreDefault - Whether or not to ignore if a default value for the
specified path exists.@Nullable public @Nullable Object get(@NotNull @NotNull String path)
If the Object does not exist but a default value has been specified, this will return the default value. If the Object does not exist and no default value was specified, this will return null.
get in interface ConfigurationSectionpath - Path of the Object to get.@Contract(value="_, !null -> !null") @Nullable public @Nullable Object get(@NotNull @NotNull String path, @Nullable @Nullable Object def)
If the Object does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
get in interface ConfigurationSectionpath - Path of the Object to get.def - The default value to return if the path is not found.public boolean isBoolean(@NotNull
@NotNull String path)
If the path exists but is not a boolean, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a boolean and return appropriately.
isBoolean in interface ConfigurationSectionpath - Path of the boolean to check.public boolean getBoolean(@NotNull
@NotNull String path)
If the boolean does not exist but a default value has been specified, this will return the default value. If the boolean does not exist and no default value was specified, this will return false.
getBoolean in interface ConfigurationSectionpath - Path of the boolean to get.public boolean getBoolean(@NotNull
@NotNull String path,
boolean def)
If the boolean does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
getBoolean in interface ConfigurationSectionpath - Path of the boolean to get.def - The default value to return if the path is not found or is
not a boolean.public boolean isByte(@NotNull
@NotNull String path)
If the path exists but is not a byte, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a byte and return appropriately.
isByte in interface ConfigurationSectionpath - Path of the byte to check.public byte getByte(@NotNull
@NotNull String path)
If the byte does not exist but a default value has been specified, this will return the default value. If the byte does not exist and no default value was specified, this will return (byte) 0.
getByte in interface ConfigurationSectionpath - Path of the byte to get.public byte getByte(@NotNull
@NotNull String path,
byte def)
If the byte does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
getByte in interface ConfigurationSectionpath - Path of the byte to get.def - The default value to return if the path is not found or is
not an byte.public boolean isShort(@NotNull
@NotNull String path)
If the path exists but is not a short, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a short and return appropriately.
isShort in interface ConfigurationSectionpath - Path of the short to check.public short getShort(@NotNull
@NotNull String path)
If the short does not exist but a default value has been specified, this will return the default value. If the short does not exist and no default value was specified, this will return (short) 0.
getShort in interface ConfigurationSectionpath - Path of the short to get.public short getShort(@NotNull
@NotNull String path,
short def)
If the short does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
getShort in interface ConfigurationSectionpath - Path of the short to get.def - The default value to return if the path is not found or is
not an short.public boolean isInt(@NotNull
@NotNull String path)
If the path exists but is not a int, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a int and return appropriately.
isInt in interface ConfigurationSectionpath - Path of the int to check.public int getInt(@NotNull
@NotNull String path)
If the int does not exist but a default value has been specified, this will return the default value. If the int does not exist and no default value was specified, this will return 0.
getInt in interface ConfigurationSectionpath - Path of the int to get.public int getInt(@NotNull
@NotNull String path,
int def)
If the int does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
getInt in interface ConfigurationSectionpath - Path of the int to get.def - The default value to return if the path is not found or is
not an int.public boolean isLong(@NotNull
@NotNull String path)
If the path exists but is not a long, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a long and return appropriately.
isLong in interface ConfigurationSectionpath - Path of the long to check.public long getLong(@NotNull
@NotNull String path)
If the long does not exist but a default value has been specified, this will return the default value. If the long does not exist and no default value was specified, this will return 0L.
getLong in interface ConfigurationSectionpath - Path of the long to get.public long getLong(@NotNull
@NotNull String path,
long def)
If the long does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
getLong in interface ConfigurationSectionpath - Path of the long to get.def - The default value to return if the path is not found or is
not a long.public boolean isFloat(@NotNull
@NotNull String path)
If the path exists but is not a float, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a float and return appropriately.
isFloat in interface ConfigurationSectionpath - Path of the float to check.public float getFloat(@NotNull
@NotNull String path)
If the float does not exist but a default value has been specified, this will return the default value. If the float does not exist and no default value was specified, this will return 0.0F.
getFloat in interface ConfigurationSectionpath - Path of the float to get.public float getFloat(@NotNull
@NotNull String path,
float def)
If the float does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
getFloat in interface ConfigurationSectionpath - Path of the float to get.def - The default value to return if the path is not found or is
not a float.public boolean isDouble(@NotNull
@NotNull String path)
If the path exists but is not a double, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a double and return appropriately.
isDouble in interface ConfigurationSectionpath - Path of the double to check.public double getDouble(@NotNull
@NotNull String path)
If the double does not exist but a default value has been specified, this will return the default value. If the double does not exist and no default value was specified, this will return 0.0D.
getDouble in interface ConfigurationSectionpath - Path of the double to get.public double getDouble(@NotNull
@NotNull String path,
double def)
If the double does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
getDouble in interface ConfigurationSectionpath - Path of the double to get.def - The default value to return if the path is not found or is
not a double.public boolean isChar(@NotNull
@NotNull String path)
If the path exists but is not a char, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a char and return appropriately.
isChar in interface ConfigurationSectionpath - Path of the double to check.public char getChar(@NotNull
@NotNull String path)
If the char does not exist but a default value has been specified, this will return the default value. If the char does not exist and no default value was specified, this will return .
getChar in interface ConfigurationSectionpath - Path of the char to get.public char getChar(@NotNull
@NotNull String path,
char def)
If the char does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
getChar in interface ConfigurationSectionpath - Path of the char to get.def - The default value to return if the path is not found or is
not a char.public boolean isString(@NotNull
@NotNull String path)
If the path exists but is not a String, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a String and return appropriately.
isString in interface ConfigurationSectionpath - Path of the String to check.@Nullable public @Nullable String getString(@NotNull @NotNull String path)
If the String does not exist but a default value has been specified, this will return the default value. If the String does not exist and no default value was specified, this will return null.
getString in interface ConfigurationSectionpath - Path of the String to get.@Contract(value="_, !null -> !null") @Nullable public @Nullable String getString(@NotNull @NotNull String path, @Nullable @Nullable String def)
If the String does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
getString in interface ConfigurationSectionpath - Path of the String to get.def - The default value to return if the path is not found or is
not a String.public boolean isList(@NotNull
@NotNull String path)
If the path exists but is not a List, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a List and return appropriately.
isList in interface ConfigurationSectionpath - Path of the List to check.@Nullable public @Nullable List<?> getList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return null.
getList in interface ConfigurationSectionpath - Path of the List to get.@Contract(value="_, !null -> !null") @Nullable public @Nullable List<?> getList(@NotNull @NotNull String path, @Nullable @Nullable List<?> def)
If the List does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.
getList in interface ConfigurationSectionpath - Path of the List to get.def - The default value to return if the path is not found or is
not a List.public boolean isConfigurationSection(@NotNull
@NotNull String path)
If the path exists but is not a ConfigurationSection, this will return false. If the path does not exist, this will return false. If the path does not exist but a default value has been specified, this will check if that default value is a ConfigurationSection and return appropriately.
isConfigurationSection in interface ConfigurationSectionpath - Path of the ConfigurationSection to check.@Nullable public @Nullable ConfigurationSection getConfigurationSection(@NotNull @NotNull String path)
If the ConfigurationSection does not exist but a default value has been specified, this will return the default value. If the ConfigurationSection does not exist and no default value was specified, this will return null.
getConfigurationSection in interface ConfigurationSectionpath - Path of the ConfigurationSection to get.@Nullable
public <T> T getObject(@NotNull
@NotNull String path,
@NotNull
@NotNull Class<T> clazz)
#getString(path) because
#getString(path) converts internally all
Objects to Strings. However, #getObject(path, Boolean.class) is
equivalent to #getBoolean(path) for example.getObject in interface ConfigurationSectionT - the type of the requested objectpath - the path to the object.clazz - the type of the requested object@Contract(value="_, _, !null -> !null")
@Nullable
public <T> T getObject(@NotNull
@NotNull String path,
@NotNull
@NotNull Class<T> clazz,
@Nullable
T def)
Configuration.
Note: For example #getObject(path, String.class, def) is
not equivalent to
#getString(path, def) because
#getString(path, def) converts
internally all Objects to Strings. However, #getObject(path,
Boolean.class, def) is equivalent to #getBoolean(path,
def) for example.getObject in interface ConfigurationSectionT - the type of the requested objectpath - the path to the object.clazz - the type of the requested objectdef - the default object to return if the object is not present at
the path@Nullable public <T extends ConfigurationSerializable> T getSerializable(@NotNull @NotNull String path, @NotNull @NotNull Class<T> clazz)
ConfigurationSerializable object at the given
path.
If the Object does not exist but a default value has been specified, this
will return the default value. If the Object does not exist and no
default value was specified, this will return null.getSerializable in interface ConfigurationSectionT - the type of ConfigurationSerializablepath - the path to the object.clazz - the type of ConfigurationSerializableConfigurationSerializable object@Contract(value="_, _, !null -> !null") @Nullable public <T extends ConfigurationSerializable> T getSerializable(@NotNull @NotNull String path, @NotNull @NotNull Class<T> clazz, @Nullable T def)
ConfigurationSerializable object at the given
path, returning a default value if not found
If the Object does not exist then the specified default value will
returned regardless of if a default has been identified in the root
Configuration.getSerializable in interface ConfigurationSectionT - the type of ConfigurationSerializablepath - the path to the object.clazz - the type of ConfigurationSerializabledef - the default object to return if the object is not present at
the pathConfigurationSerializable object@NotNull public @NotNull List<Boolean> getBooleanList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a Boolean if possible, but may miss any values out if they are not compatible.
getBooleanList in interface ConfigurationSectionpath - Path of the List to get.@NotNull public @NotNull List<Byte> getByteList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a Byte if possible, but may miss any values out if they are not compatible.
getByteList in interface ConfigurationSectionpath - Path of the List to get.@NotNull public @NotNull List<Short> getShortList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a Short if possible, but may miss any values out if they are not compatible.
getShortList in interface ConfigurationSectionpath - Path of the List to get.@NotNull public @NotNull List<Integer> getIntList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a Integer if possible, but may miss any values out if they are not compatible.
getIntList in interface ConfigurationSectionpath - Path of the List to get.@NotNull public @NotNull List<Long> getLongList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a Long if possible, but may miss any values out if they are not compatible.
getLongList in interface ConfigurationSectionpath - Path of the List to get.@NotNull public @NotNull List<Float> getFloatList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a Float if possible, but may miss any values out if they are not compatible.
getFloatList in interface ConfigurationSectionpath - Path of the List to get.@NotNull public @NotNull List<Double> getDoubleList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a Double if possible, but may miss any values out if they are not compatible.
getDoubleList in interface ConfigurationSectionpath - Path of the List to get.@NotNull public @NotNull List<Character> getCharList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a Character if possible, but may miss any values out if they are not compatible.
getCharList in interface ConfigurationSectionpath - Path of the List to get.@NotNull public @NotNull List<String> getStringList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a String if possible, but may miss any values out if they are not compatible.
getStringList in interface ConfigurationSectionpath - Path of the List to get.@NotNull public @NotNull List<Map<?,?>> getMapList(@NotNull @NotNull String path)
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a Map if possible, but may miss any values out if they are not compatible.
getMapList in interface ConfigurationSectionpath - Path of the List to get.@Nullable protected @Nullable Object getDefault(@NotNull @NotNull String path)
Object for the given path.protected void mapChildrenKeys(@NotNull
@NotNull Set<String> output,
@NotNull
@NotNull ConfigurationSection section,
boolean deep)
ConfigurationSection.output - The mapped keys.section - The child ConfigurationSection.deep - If true, any children of the given
ConfigurationSection will have their keys mapped. If
false, only the given
ConfigurationSection's keys will be mapped.protected void mapChildrenValues(@NotNull
@NotNull Map<String,Object> output,
@NotNull
@NotNull ConfigurationSection section,
boolean deep)
ConfigurationSection.output - The mapped key-value pairs.section - The child ConfigurationSection.deep - If true, any children of the given
ConfigurationSection will have their key-value pairs
mapped. If false, only the given
ConfigurationSection's key-value pairs will be
mapped.public String toString()
String representation of this MemorySection.toString in class ObjectString representation of this MemorySection.@NotNull public static @NotNull String createPath(@NotNull @NotNull ConfigurationSection section, @Nullable @Nullable String key)
ConfigurationSection from its
root Configuration.
You may use this method for any given ConfigurationSection, not
only MemorySection.
section - Section to create a path for.key - Name of the specified section.@NotNull public static @NotNull String createPath(@NotNull @NotNull ConfigurationSection section, @Nullable @Nullable String key, @Nullable @Nullable ConfigurationSection relative)
ConfigurationSection from
the given relative section.
You may use this method for any given ConfigurationSection, not
only MemorySection.
section - Section to create a path for.key - Name of the specified section.relative - Section to create the path relative to.Copyright © 2021 BSPF Systems, LLC. All rights reserved.