Class MemorySection
- All Implemented Interfaces:
- ConfigurationSection
- Direct Known Subclasses:
- MemoryConfiguration
ConfigurationSection that is stored in memory.- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCreates an empty MemorySection for use as a rootConfigurationsection.protectedMemorySection(ConfigurationSection parent, String path) Creates an empty MemorySection with the specified parent and path.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddDefault(String path, Object value) Sets the default value in the root at the given path as provided.booleanChecks if thisConfigurationSectioncontains the given path.booleanChecks if thisConfigurationSectioncontains the given path.static StringcreatePath(ConfigurationSection section, String key) Creates a full path to the givenConfigurationSectionfrom its rootConfiguration.static StringcreatePath(ConfigurationSection section, String key, ConfigurationSection relativeTo) Creates a relative path to the givenConfigurationSectionfrom the given relative section.createSection(String path) Creates an emptyConfigurationSectionat the specified path.createSection(String path, Map<?, ?> map) Creates aConfigurationSectionat the specified path, with specified values.Gets the requested Object by path.Gets the requested Object by path, returning a default value if not found.booleangetBoolean(String path) Gets the requested boolean by path.booleangetBoolean(String path, boolean def) Gets the requested boolean by path, returning a default value if not found.getBooleanList(String path) Gets the requested List of Boolean by path.getByteList(String path) Gets the requested List of Byte by path.getCharacterList(String path) Gets the requested List of Character by path.Gets the requested Color by path.Gets the requestedColorby path, returning a default value if not found.getComments(String path) Gets the requested comment list by path.Gets the requested ConfigurationSection by path.Gets the path of thisConfigurationSectionfrom its rootConfigurationprotected ObjectgetDefault(String path) Gets the equivalentConfigurationSectionfrom the defaultConfigurationdefined inConfigurationSection.getRoot().doubleGets the requested double by path.doubleGets the requested double by path, returning a default value if not found.getDoubleList(String path) Gets the requested List of Double by path.getFloatList(String path) Gets the requested List of Float by path.getInlineComments(String path) Gets the requested inline comment list by path.intGets the requested int by path.intGets the requested int by path, returning a default value if not found.getIntegerList(String path) Gets the requested List of Integer by path.getItemStack(String path) Gets the requested ItemStack by path.getItemStack(String path, ItemStack def) Gets the requestedItemStackby path, returning a default value if not found.getKeys(boolean deep) Gets a set containing all keys in this section.List<?> Gets the requested List by path.List<?> Gets the requested List by path, returning a default value if not found.getLocation(String path) Gets the requested Location by path.getLocation(String path, Location def) Gets the requestedLocationby path, returning a default value if not found.longGets the requested long by path.longGets the requested long by path, returning a default value if not found.getLongList(String path) Gets the requested List of Long by path.getMapList(String path) Gets the requested List of Maps by path.getName()Gets the name of this individualConfigurationSection, in the path.<T> TGets the requested object at the given path.<T> TGets 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 rootConfiguration.getOfflinePlayer(String path) Gets the requested OfflinePlayer by path.getOfflinePlayer(String path, OfflinePlayer def) Gets the requestedOfflinePlayerby path, returning a default value if not found.Gets the parentConfigurationSectionthat directly contains thisConfigurationSection.getRoot()Gets the rootConfigurationthat contains thisConfigurationSection<T extends ConfigurationSerializable>
 TgetSerializable(String path, Class<T> clazz) Gets the requestedConfigurationSerializableobject at the given path.<T extends ConfigurationSerializable>
 TgetSerializable(String path, Class<T> clazz, T def) Gets the requestedConfigurationSerializableobject 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 rootConfiguration.getShortList(String path) Gets the requested List of Short by path.Gets the requested String by path.Gets the requested String by path, returning a default value if not found.getStringList(String path) Gets the requested List of String by path.getValues(boolean deep) Gets a Map containing all keys and their values for this section.Gets the requested Vector by path.Gets the requestedVectorby path, returning a default value if not found.booleanChecks if the specified path is a boolean.booleanChecks if the specified path is a Color.booleanisConfigurationSection(String path) Checks if the specified path is a ConfigurationSection.booleanChecks if the specified path is a double.booleanChecks if the specified path is an int.booleanisItemStack(String path) Checks if the specified path is an ItemStack.booleanChecks if the specified path is a List.booleanisLocation(String path) Checks if the specified path is a Location.booleanChecks if the specified path is a long.booleanisOfflinePlayer(String path) Checks if the specified path is an OfflinePlayer.protected booleanisPrimitiveWrapper(Object input) booleanChecks if thisConfigurationSectionhas a value set for the given path.booleanChecks if the specified path is a String.booleanChecks if the specified path is a Vector.protected voidmapChildrenKeys(Set<String> output, ConfigurationSection section, boolean deep) protected voidmapChildrenValues(Map<String, Object> output, ConfigurationSection section, boolean deep) voidSets the specified path to the given value.voidsetComments(String path, List<String> comments) Sets the comment list at the specified path.voidsetInlineComments(String path, List<String> comments) Sets the inline comment list at the specified path.toString()
- 
Field Details- 
map
 
- 
- 
Constructor Details- 
MemorySectionprotected MemorySection()Creates an empty MemorySection for use as a rootConfigurationsection.Note that calling this without being yourself a Configurationwill throw an exception!- Throws:
- IllegalStateException- Thrown if this is not a- Configurationroot.
 
- 
MemorySectionCreates an empty MemorySection with the specified parent and path.- Parameters:
- parent- Parent section that contains this own section.
- path- Path that you may access this section from via the root- Configuration.
- Throws:
- IllegalArgumentException- Thrown is parent or path is null, or if parent contains no root Configuration.
 
 
- 
- 
Method Details- 
getKeysDescription copied from interface:ConfigurationSectionGets a set containing all keys in this section.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. - Specified by:
- getKeysin interface- ConfigurationSection
- Parameters:
- deep- Whether or not to get a deep list, as opposed to a shallow list.
- Returns:
- Set of keys contained within this ConfigurationSection.
 
- 
getValuesDescription copied from interface:ConfigurationSectionGets a Map containing all keys and their values for this section.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. - Specified by:
- getValuesin interface- ConfigurationSection
- Parameters:
- deep- Whether or not to get a deep list, as opposed to a shallow list.
- Returns:
- Map of keys and values of this section.
 
- 
containsDescription copied from interface:ConfigurationSectionChecks if thisConfigurationSectioncontains the given path.If the value for the requested path does not exist but a default value has been specified, this will return true. - Specified by:
- containsin interface- ConfigurationSection
- Parameters:
- path- Path to check for existence.
- Returns:
- True if this section contains the requested path, either via default or being set.
 
- 
containsDescription copied from interface:ConfigurationSectionChecks if thisConfigurationSectioncontains 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. - Specified by:
- containsin interface- ConfigurationSection
- Parameters:
- path- Path to check for existence.
- ignoreDefault- Whether or not to ignore if a default value for the specified path exists.
- Returns:
- True if this section contains the requested path, or if a default value exist and the boolean parameter for this method is true.
 
- 
isSetDescription copied from interface:ConfigurationSectionChecks if thisConfigurationSectionhas 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. - Specified by:
- isSetin interface- ConfigurationSection
- Parameters:
- path- Path to check for existence.
- Returns:
- True if this section contains the requested path, regardless of having a default.
 
- 
getCurrentPathDescription copied from interface:ConfigurationSectionGets the path of thisConfigurationSectionfrom its rootConfigurationFor any Configurationthemselves, 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().- Specified by:
- getCurrentPathin interface- ConfigurationSection
- Returns:
- Path of this section relative to its root
 
- 
getNameDescription copied from interface:ConfigurationSectionGets the name of this individualConfigurationSection, in the path.This will always be the final part of ConfigurationSection.getCurrentPath(), unless the section is orphaned.- Specified by:
- getNamein interface- ConfigurationSection
- Returns:
- Name of this section
 
- 
getRootDescription copied from interface:ConfigurationSectionGets the rootConfigurationthat contains thisConfigurationSectionFor any Configurationthemselves, 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. - Specified by:
- getRootin interface- ConfigurationSection
- Returns:
- Root configuration containing this section.
 
- 
getParentDescription copied from interface:ConfigurationSectionGets the parentConfigurationSectionthat directly contains thisConfigurationSection.For any Configurationthemselves, 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. - Specified by:
- getParentin interface- ConfigurationSection
- Returns:
- Parent section containing this section.
 
- 
addDefaultDescription copied from interface:ConfigurationSectionSets the default value in the root at the given path as provided.If no source Configurationwas provided as a default collection, then a newMemoryConfigurationwill 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.- Specified by:
- addDefaultin interface- ConfigurationSection
- Parameters:
- path- Path of the value to set.
- value- Value to set the default to.
 
- 
getDefaultSectionDescription copied from interface:ConfigurationSectionGets the equivalentConfigurationSectionfrom the defaultConfigurationdefined inConfigurationSection.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 ConfigurationSectionthen this will return null.- Specified by:
- getDefaultSectionin interface- ConfigurationSection
- Returns:
- Equivalent section in root configuration
 
- 
setDescription copied from interface:ConfigurationSectionSets the specified path to the given 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 orConfigurationSections, please useConfigurationSection.createSection(java.lang.String)for that.- Specified by:
- setin interface- ConfigurationSection
- Parameters:
- path- Path of the object to set.
- value- New value to set the path to.
 
- 
getDescription copied from interface:ConfigurationSectionGets the requested Object by 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. - Specified by:
- getin interface- ConfigurationSection
- Parameters:
- path- Path of the Object to get.
- Returns:
- Requested Object.
 
- 
get@Contract("_, !null -> !null") @Nullable public Object get(@NotNull String path, @Nullable Object def) Description copied from interface:ConfigurationSectionGets the requested Object by 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.- Specified by:
- getin interface- ConfigurationSection
- Parameters:
- path- Path of the Object to get.
- def- The default value to return if the path is not found.
- Returns:
- Requested Object.
 
- 
createSectionDescription copied from interface:ConfigurationSectionCreates an emptyConfigurationSectionat 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.- Specified by:
- createSectionin interface- ConfigurationSection
- Parameters:
- path- Path to create the section at.
- Returns:
- Newly created section
 
- 
createSectionDescription copied from interface:ConfigurationSectionCreates aConfigurationSectionat 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.- Specified by:
- createSectionin interface- ConfigurationSection
- Parameters:
- path- Path to create the section at.
- map- The values to used.
- Returns:
- Newly created section
 
- 
getStringDescription copied from interface:ConfigurationSectionGets the requested String by 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. - Specified by:
- getStringin interface- ConfigurationSection
- Parameters:
- path- Path of the String to get.
- Returns:
- Requested String.
 
- 
getString@Contract("_, !null -> !null") @Nullable public String getString(@NotNull String path, @Nullable String def) Description copied from interface:ConfigurationSectionGets the requested String by path, returning a default value if not found.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.- Specified by:
- getStringin interface- ConfigurationSection
- Parameters:
- path- Path of the String to get.
- def- The default value to return if the path is not found or is not a String.
- Returns:
- Requested String.
 
- 
isStringDescription copied from interface:ConfigurationSectionChecks if the specified path is a String.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. - Specified by:
- isStringin interface- ConfigurationSection
- Parameters:
- path- Path of the String to check.
- Returns:
- Whether or not the specified path is a String.
 
- 
getIntDescription copied from interface:ConfigurationSectionGets the requested int by 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. - Specified by:
- getIntin interface- ConfigurationSection
- Parameters:
- path- Path of the int to get.
- Returns:
- Requested int.
 
- 
getIntDescription copied from interface:ConfigurationSectionGets the requested int by path, returning a default value if not found.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.- Specified by:
- getIntin interface- ConfigurationSection
- Parameters:
- path- Path of the int to get.
- def- The default value to return if the path is not found or is not an int.
- Returns:
- Requested int.
 
- 
isIntDescription copied from interface:ConfigurationSectionChecks if the specified path is an int.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. - Specified by:
- isIntin interface- ConfigurationSection
- Parameters:
- path- Path of the int to check.
- Returns:
- Whether or not the specified path is an int.
 
- 
getBooleanDescription copied from interface:ConfigurationSectionGets the requested boolean by 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. - Specified by:
- getBooleanin interface- ConfigurationSection
- Parameters:
- path- Path of the boolean to get.
- Returns:
- Requested boolean.
 
- 
getBooleanDescription copied from interface:ConfigurationSectionGets the requested boolean by path, returning a default value if not found.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.- Specified by:
- getBooleanin interface- ConfigurationSection
- Parameters:
- path- Path of the boolean to get.
- def- The default value to return if the path is not found or is not a boolean.
- Returns:
- Requested boolean.
 
- 
isBooleanDescription copied from interface:ConfigurationSectionChecks if the specified path is a boolean.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. - Specified by:
- isBooleanin interface- ConfigurationSection
- Parameters:
- path- Path of the boolean to check.
- Returns:
- Whether or not the specified path is a boolean.
 
- 
getDoubleDescription copied from interface:ConfigurationSectionGets the requested double by 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. - Specified by:
- getDoublein interface- ConfigurationSection
- Parameters:
- path- Path of the double to get.
- Returns:
- Requested double.
 
- 
getDoubleDescription copied from interface:ConfigurationSectionGets the requested double by path, returning a default value if not found.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.- Specified by:
- getDoublein interface- ConfigurationSection
- Parameters:
- path- Path of the double to get.
- def- The default value to return if the path is not found or is not a double.
- Returns:
- Requested double.
 
- 
isDoubleDescription copied from interface:ConfigurationSectionChecks if the specified path is a double.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. - Specified by:
- isDoublein interface- ConfigurationSection
- Parameters:
- path- Path of the double to check.
- Returns:
- Whether or not the specified path is a double.
 
- 
getLongDescription copied from interface:ConfigurationSectionGets the requested long by 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 0. - Specified by:
- getLongin interface- ConfigurationSection
- Parameters:
- path- Path of the long to get.
- Returns:
- Requested long.
 
- 
getLongDescription copied from interface:ConfigurationSectionGets the requested long by path, returning a default value if not found.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.- Specified by:
- getLongin interface- ConfigurationSection
- Parameters:
- path- Path of the long to get.
- def- The default value to return if the path is not found or is not a long.
- Returns:
- Requested long.
 
- 
isLongDescription copied from interface:ConfigurationSectionChecks if the specified path is a long.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. - Specified by:
- isLongin interface- ConfigurationSection
- Parameters:
- path- Path of the long to check.
- Returns:
- Whether or not the specified path is a long.
 
- 
getListDescription copied from interface:ConfigurationSectionGets the requested List by 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. - Specified by:
- getListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List.
 
- 
getList@Contract("_, !null -> !null") @Nullable public List<?> getList(@NotNull String path, @Nullable List<?> def) Description copied from interface:ConfigurationSectionGets the requested List by path, returning a default value if not found.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.- Specified by:
- getListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- def- The default value to return if the path is not found or is not a List.
- Returns:
- Requested List.
 
- 
isListDescription copied from interface:ConfigurationSectionChecks if the specified path is a List.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. - Specified by:
- isListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to check.
- Returns:
- Whether or not the specified path is a List.
 
- 
getStringListDescription copied from interface:ConfigurationSectionGets the requested List of String by 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. - Specified by:
- getStringListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List of String.
 
- 
getIntegerListDescription copied from interface:ConfigurationSectionGets the requested List of Integer by 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. - Specified by:
- getIntegerListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List of Integer.
 
- 
getBooleanListDescription copied from interface:ConfigurationSectionGets the requested List of Boolean by 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. - Specified by:
- getBooleanListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List of Boolean.
 
- 
getDoubleListDescription copied from interface:ConfigurationSectionGets the requested List of Double by 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. - Specified by:
- getDoubleListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List of Double.
 
- 
getFloatListDescription copied from interface:ConfigurationSectionGets the requested List of Float by 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. - Specified by:
- getFloatListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List of Float.
 
- 
getLongListDescription copied from interface:ConfigurationSectionGets the requested List of Long by 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. - Specified by:
- getLongListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List of Long.
 
- 
getByteListDescription copied from interface:ConfigurationSectionGets the requested List of Byte by 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. - Specified by:
- getByteListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List of Byte.
 
- 
getCharacterListDescription copied from interface:ConfigurationSectionGets the requested List of Character by 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. - Specified by:
- getCharacterListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List of Character.
 
- 
getShortListDescription copied from interface:ConfigurationSectionGets the requested List of Short by 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. - Specified by:
- getShortListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List of Short.
 
- 
getMapListDescription copied from interface:ConfigurationSectionGets the requested List of Maps by 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. - Specified by:
- getMapListin interface- ConfigurationSection
- Parameters:
- path- Path of the List to get.
- Returns:
- Requested List of Maps.
 
- 
getObjectDescription copied from interface:ConfigurationSectionGets the requested 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. Note: For example #getObject(path, String.class) is not equivalent to#getString(path)because#getString(path)converts internally all Objects to Strings. However, #getObject(path, Boolean.class) is equivalent to#getBoolean(path)for example.- Specified by:
- getObjectin interface- ConfigurationSection
- Type Parameters:
- T- the type of the requested object
- Parameters:
- path- the path to the object.
- clazz- the type of the requested object
- Returns:
- Requested object
 
- 
getObject@Contract("_, _, !null -> !null") @Nullable public <T> T getObject(@NotNull String path, @NotNull Class<T> clazz, @Nullable T def) Description copied from interface:ConfigurationSectionGets 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 rootConfiguration. 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.- Specified by:
- getObjectin interface- ConfigurationSection
- Type Parameters:
- T- the type of the requested object
- Parameters:
- path- the path to the object.
- clazz- the type of the requested object
- def- the default object to return if the object is not present at the path
- Returns:
- Requested object
 
- 
getSerializable@Nullable public <T extends ConfigurationSerializable> T getSerializable(@NotNull String path, @NotNull Class<T> clazz) Description copied from interface:ConfigurationSectionGets the requestedConfigurationSerializableobject 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.- Specified by:
- getSerializablein interface- ConfigurationSection
- Type Parameters:
- T- the type of- ConfigurationSerializable
- Parameters:
- path- the path to the object.
- clazz- the type of- ConfigurationSerializable
- Returns:
- Requested ConfigurationSerializableobject
 
- 
getSerializable@Contract("_, _, !null -> !null") @Nullable public <T extends ConfigurationSerializable> T getSerializable(@NotNull String path, @NotNull Class<T> clazz, @Nullable T def) Description copied from interface:ConfigurationSectionGets the requestedConfigurationSerializableobject 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 rootConfiguration.- Specified by:
- getSerializablein interface- ConfigurationSection
- Type Parameters:
- T- the type of- ConfigurationSerializable
- Parameters:
- path- the path to the object.
- clazz- the type of- ConfigurationSerializable
- def- the default object to return if the object is not present at the path
- Returns:
- Requested ConfigurationSerializableobject
 
- 
getVectorDescription copied from interface:ConfigurationSectionGets the requested Vector by path.If the Vector does not exist but a default value has been specified, this will return the default value. If the Vector does not exist and no default value was specified, this will return null. - Specified by:
- getVectorin interface- ConfigurationSection
- Parameters:
- path- Path of the Vector to get.
- Returns:
- Requested Vector.
 
- 
getVector@Contract("_, !null -> !null") @Nullable public Vector getVector(@NotNull String path, @Nullable Vector def) Description copied from interface:ConfigurationSectionGets the requestedVectorby path, returning a default value if not found.If the Vector does not exist then the specified default value will returned regardless of if a default has been identified in the root Configuration.- Specified by:
- getVectorin interface- ConfigurationSection
- Parameters:
- path- Path of the Vector to get.
- def- The default value to return if the path is not found or is not a Vector.
- Returns:
- Requested Vector.
 
- 
isVectorDescription copied from interface:ConfigurationSectionChecks if the specified path is a Vector.If the path exists but is not a Vector, 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 Vector and return appropriately. - Specified by:
- isVectorin interface- ConfigurationSection
- Parameters:
- path- Path of the Vector to check.
- Returns:
- Whether or not the specified path is a Vector.
 
- 
getOfflinePlayerDescription copied from interface:ConfigurationSectionGets the requested OfflinePlayer by path.If the OfflinePlayer does not exist but a default value has been specified, this will return the default value. If the OfflinePlayer does not exist and no default value was specified, this will return null. - Specified by:
- getOfflinePlayerin interface- ConfigurationSection
- Parameters:
- path- Path of the OfflinePlayer to get.
- Returns:
- Requested OfflinePlayer.
 
- 
getOfflinePlayer@Contract("_, !null -> !null") @Nullable public OfflinePlayer getOfflinePlayer(@NotNull String path, @Nullable OfflinePlayer def) Description copied from interface:ConfigurationSectionGets the requestedOfflinePlayerby path, returning a default value if not found.If the OfflinePlayer does not exist then the specified default value will returned regardless of if a default has been identified in the root Configuration.- Specified by:
- getOfflinePlayerin interface- ConfigurationSection
- Parameters:
- path- Path of the OfflinePlayer to get.
- def- The default value to return if the path is not found or is not an OfflinePlayer.
- Returns:
- Requested OfflinePlayer.
 
- 
isOfflinePlayerDescription copied from interface:ConfigurationSectionChecks if the specified path is an OfflinePlayer.If the path exists but is not a OfflinePlayer, 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 OfflinePlayer and return appropriately. - Specified by:
- isOfflinePlayerin interface- ConfigurationSection
- Parameters:
- path- Path of the OfflinePlayer to check.
- Returns:
- Whether or not the specified path is an OfflinePlayer.
 
- 
getItemStackDescription copied from interface:ConfigurationSectionGets the requested ItemStack by path.If the ItemStack does not exist but a default value has been specified, this will return the default value. If the ItemStack does not exist and no default value was specified, this will return null. - Specified by:
- getItemStackin interface- ConfigurationSection
- Parameters:
- path- Path of the ItemStack to get.
- Returns:
- Requested ItemStack.
 
- 
getItemStack@Contract("_, !null -> !null") @Nullable public ItemStack getItemStack(@NotNull String path, @Nullable ItemStack def) Description copied from interface:ConfigurationSectionGets the requestedItemStackby path, returning a default value if not found.If the ItemStack does not exist then the specified default value will returned regardless of if a default has been identified in the root Configuration.- Specified by:
- getItemStackin interface- ConfigurationSection
- Parameters:
- path- Path of the ItemStack to get.
- def- The default value to return if the path is not found or is not an ItemStack.
- Returns:
- Requested ItemStack.
 
- 
isItemStackDescription copied from interface:ConfigurationSectionChecks if the specified path is an ItemStack.If the path exists but is not a ItemStack, 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 ItemStack and return appropriately. - Specified by:
- isItemStackin interface- ConfigurationSection
- Parameters:
- path- Path of the ItemStack to check.
- Returns:
- Whether or not the specified path is an ItemStack.
 
- 
getColorDescription copied from interface:ConfigurationSectionGets the requested Color by path.If the Color does not exist but a default value has been specified, this will return the default value. If the Color does not exist and no default value was specified, this will return null. - Specified by:
- getColorin interface- ConfigurationSection
- Parameters:
- path- Path of the Color to get.
- Returns:
- Requested Color.
 
- 
getColor@Contract("_, !null -> !null") @Nullable public Color getColor(@NotNull String path, @Nullable Color def) Description copied from interface:ConfigurationSectionGets the requestedColorby path, returning a default value if not found.If the Color does not exist then the specified default value will returned regardless of if a default has been identified in the root Configuration.- Specified by:
- getColorin interface- ConfigurationSection
- Parameters:
- path- Path of the Color to get.
- def- The default value to return if the path is not found or is not a Color.
- Returns:
- Requested Color.
 
- 
isColorDescription copied from interface:ConfigurationSectionChecks if the specified path is a Color.If the path exists but is not a Color, 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 Color and return appropriately. - Specified by:
- isColorin interface- ConfigurationSection
- Parameters:
- path- Path of the Color to check.
- Returns:
- Whether or not the specified path is a Color.
 
- 
getLocationDescription copied from interface:ConfigurationSectionGets the requested Location by path.If the Location does not exist but a default value has been specified, this will return the default value. If the Location does not exist and no default value was specified, this will return null. - Specified by:
- getLocationin interface- ConfigurationSection
- Parameters:
- path- Path of the Location to get.
- Returns:
- Requested Location.
 
- 
getLocation@Contract("_, !null -> !null") @Nullable public Location getLocation(@NotNull String path, @Nullable Location def) Description copied from interface:ConfigurationSectionGets the requestedLocationby path, returning a default value if not found.If the Location does not exist then the specified default value will returned regardless of if a default has been identified in the root Configuration.- Specified by:
- getLocationin interface- ConfigurationSection
- Parameters:
- path- Path of the Location to get.
- def- The default value to return if the path is not found or is not a Location.
- Returns:
- Requested Location.
 
- 
isLocationDescription copied from interface:ConfigurationSectionChecks if the specified path is a Location.If the path exists but is not a Location, 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 Location and return appropriately. - Specified by:
- isLocationin interface- ConfigurationSection
- Parameters:
- path- Path of the Location to check.
- Returns:
- Whether or not the specified path is a Location.
 
- 
getConfigurationSectionDescription copied from interface:ConfigurationSectionGets the requested ConfigurationSection by 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. - Specified by:
- getConfigurationSectionin interface- ConfigurationSection
- Parameters:
- path- Path of the ConfigurationSection to get.
- Returns:
- Requested ConfigurationSection.
 
- 
isConfigurationSectionDescription copied from interface:ConfigurationSectionChecks if the specified path is a ConfigurationSection.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. - Specified by:
- isConfigurationSectionin interface- ConfigurationSection
- Parameters:
- path- Path of the ConfigurationSection to check.
- Returns:
- Whether or not the specified path is a ConfigurationSection.
 
- 
isPrimitiveWrapper
- 
getDefault
- 
mapChildrenKeysprotected void mapChildrenKeys(@NotNull Set<String> output, @NotNull ConfigurationSection section, boolean deep) 
- 
mapChildrenValuesprotected void mapChildrenValues(@NotNull Map<String, Object> output, @NotNull ConfigurationSection section, boolean deep) 
- 
createPath@NotNull public static String createPath(@NotNull ConfigurationSection section, @Nullable String key) Creates a full path to the givenConfigurationSectionfrom its rootConfiguration.You may use this method for any given ConfigurationSection, not onlyMemorySection.- Parameters:
- section- Section to create a path for.
- key- Name of the specified section.
- Returns:
- Full path of the section from its root.
 
- 
createPath@NotNull public static String createPath(@NotNull ConfigurationSection section, @Nullable String key, @Nullable ConfigurationSection relativeTo) Creates a relative path to the givenConfigurationSectionfrom the given relative section.You may use this method for any given ConfigurationSection, not onlyMemorySection.- Parameters:
- section- Section to create a path for.
- key- Name of the specified section.
- relativeTo- Section to create the path relative to.
- Returns:
- Full path of the section from its root.
 
- 
getCommentsDescription copied from interface:ConfigurationSectionGets the requested comment list by path.If no comments exist, an empty list will be returned. A null entry represents an empty line and an empty String represents an empty comment line. - Specified by:
- getCommentsin interface- ConfigurationSection
- Parameters:
- path- Path of the comments to get.
- Returns:
- A unmodifiable list of the requested comments, every entry represents one line.
 
- 
getInlineCommentsDescription copied from interface:ConfigurationSectionGets the requested inline comment list by path.If no comments exist, an empty list will be returned. A null entry represents an empty line and an empty String represents an empty comment line. - Specified by:
- getInlineCommentsin interface- ConfigurationSection
- Parameters:
- path- Path of the comments to get.
- Returns:
- A unmodifiable list of the requested comments, every entry represents one line.
 
- 
setCommentsDescription copied from interface:ConfigurationSectionSets the comment list at the specified path.If value is null, the comments will be removed. A null entry is an empty line and an empty String entry is an empty comment line. If the path does not exist, no comments will be set. Any existing comments will be replaced, regardless of what the new comments are. Some implementations may have limitations on what persists. See their individual javadocs for details. - Specified by:
- setCommentsin interface- ConfigurationSection
- Parameters:
- path- Path of the comments to set.
- comments- New comments to set at the path, every entry represents one line.
 
- 
setInlineCommentsDescription copied from interface:ConfigurationSectionSets the inline comment list at the specified path.If value is null, the comments will be removed. A null entry is an empty line and an empty String entry is an empty comment line. If the path does not exist, no comment will be set. Any existing comments will be replaced, regardless of what the new comments are. Some implementations may have limitations on what persists. See their individual javadocs for details. - Specified by:
- setInlineCommentsin interface- ConfigurationSection
- Parameters:
- path- Path of the comments to set.
- comments- New comments to set at the path, every entry represents one line.
 
- 
toString
 
-