Class ShadedSection
- All Implemented Interfaces:
ConfigureSection
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @Nullable ShadedSectionprotected @Nullable ConfigureSectionprotected @NotNull ConfigureSection -
Constructor Summary
ConstructorsConstructorDescriptionShadedSection(@Nullable ShadedSection parent, @NotNull ConfigureSection template, @Nullable ConfigureSection source) -
Method Summary
Modifier and TypeMethodDescriptionasMap()Get this section as a map.static ShadedSectioncreate(@NotNull ConfigureSection template, @Nullable ConfigureSection source) @NotNull ConfigureSectioncreateSection(@NotNull String path, @NotNull Map<?, ?> data) Creates a newConfigureSectionwith specified values.@Nullable ObjectGet the origin value of the path.@Nullable ObjectgetFromTemplate(@NotNull String path) getKeys(boolean deep) Gets a set containing all keys in this section.@Nullable ConfigureSectiongetValues(boolean deep) Gets a set containing all values in this section.@Nullable ConfigureSectionparent()Gets the parent section of this section.@NotNull Stringpath()Get the current section's path fromConfigureSection.parent()of this section.voidRemoves the value at the given path.voidSets the value at the given path.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cc.carm.lib.configuration.source.section.ConfigureSection
childPath, computeSection, computeSection, computeSection, computeSection, contains, containsValue, createSection, createSection, createSection, forEach, fullPath, get, get, get, get, getBoolean, getBoolean, getByte, getByte, getByteList, getChar, getChar, getCharList, getCollection, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInt, getInt, getIntegerList, getList, getList, getLong, getLong, getLongList, getSection, getSectionList, getShort, getShort, getString, getString, getStringList, isBoolean, isByte, isChar, isDouble, isEmpty, isFloat, isInt, isList, isLong, isRoot, isSection, isShort, isString, isType, keys, pathSeparator, size, stream, stream, stream, values
-
Field Details
-
parent
-
template
-
source
-
-
Constructor Details
-
ShadedSection
public ShadedSection(@Nullable @Nullable ShadedSection parent, @NotNull @NotNull ConfigureSection template, @Nullable @Nullable ConfigureSection source)
-
-
Method Details
-
create
public static ShadedSection create(@NotNull @NotNull ConfigureSection template, @Nullable @Nullable ConfigureSection source) -
parent
Description copied from interface:ConfigureSectionGets the parent section of this section.For root sections, this will return null.
- Specified by:
parentin interfaceConfigureSection- Returns:
- Parent section, or null if this is a root section.
-
path
Description copied from interface:ConfigureSectionGet the current section's path fromConfigureSection.parent()of this section.- Specified by:
pathin interfaceConfigureSection- Returns:
- The current path of this section, if
ConfigureSection.isRoot(), return empty string.
-
getValues
Description copied from interface:ConfigureSectionGets a set containing all values in this section.If deep is set to true, then this will contain all the keys within any child
ConfigureSections (and their children paths).If deep is set to false, then this will contain only the keys of any direct children, and not their own children.
- Specified by:
getValuesin interfaceConfigureSection- Parameters:
deep- Whether to get a deep list.- Returns:
- Map of data values contained within this Section.
-
asMap
Description copied from interface:ConfigureSectionGet this section as a map.In this map, child
ConfigureSections will also be represented asMaps.- Specified by:
asMapin interfaceConfigureSection- Returns:
- Map of data values contained within this Section.
-
getKeys
Description copied from interface:ConfigureSectionGets a set containing all keys in this section.If deep is set to true, then this will contain all the keys within any child
ConfigureSections (and their children paths).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 interfaceConfigureSection- Parameters:
deep- Whether to get a deep list.- Returns:
- Set of keys contained within this Section.
-
set
Description copied from interface:ConfigureSectionSets the value at the given path.Null values will be kept, if you want to remove a value use
ConfigureSection.remove(String)Path separator depends on holder'sStandardOptions.PATH_SEPARATOR- Specified by:
setin interfaceConfigureSection- Parameters:
path- The path to set the value at.value- The value to set.
-
remove
Description copied from interface:ConfigureSectionRemoves the value at the given path.Path separator depends on holder's
StandardOptions.PATH_SEPARATOR- Specified by:
removein interfaceConfigureSection- Parameters:
path- The path to remove the value at.
-
createSection
@NotNull public @NotNull ConfigureSection createSection(@NotNull @NotNull String path, @NotNull @NotNull Map<?, ?> data) Description copied from interface:ConfigureSectionCreates a newConfigureSectionwith specified values.The
ConfigureSection.parent()of the new section will be this section.This section will not be saved until
ConfigureSection.set(String, Object)is called.If you want to create and use a section and set it to this section, use
ConfigureSection.computeSection(String).- Specified by:
createSectionin interfaceConfigureSection- Parameters:
data- The data to be used to create section.- Returns:
- Newly created section
-
get
Description copied from interface:ConfigureSectionGet the origin value of the path.- Specified by:
getin interfaceConfigureSection- Parameters:
path- The path to get the value from.- Returns:
- The value at the path, or null if not found.
-
getFromTemplate
-
getSource
-