Class ImmutableSection
- java.lang.Object
-
- cc.carm.lib.configuration.source.section.ImmutableSection
-
- All Implemented Interfaces:
ConfigureSection
public class ImmutableSection extends java.lang.Object implements ConfigureSection
-
-
Field Summary
Fields Modifier and Type Field Description protected @Nullable ImmutableSectionparentprotected @NotNull ConfigureSectionraw
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull @UnmodifiableView java.util.Map<java.lang.String,java.lang.Object>asMap()Get this section as a map.java.lang.StringchildPath(java.lang.String path)booleancontains(@NotNull java.lang.String path)Check if the given path is present.booleancontainsValue(@NotNull java.lang.String path)Check if the value of given path is present.@NotNull ImmutableSectioncreateSection(@NotNull java.lang.String path, @NotNull java.util.Map<?,?> data)Creates a newConfigureSectionwith specified values.booleanequals(java.lang.Object obj)voidforEach(@NotNull java.util.function.BiConsumer<java.lang.String,java.lang.Object> action)Iterates over all key-values in this section (include child sections)@Nullable java.lang.Objectget(@NotNull java.lang.String path)Get the origin value of the path.<T> Tget(@NotNull java.lang.String path, @NotNull DataFunction<@Nullable java.lang.Object,T> parser)Get the value of the path using a parser function, if the path does not exist, return NULL.<T> Tget(@NotNull java.lang.String path, @NotNull java.lang.Class<T> type)Get the value of the path for specific type, if the path does not exist, return null.<T> Tget(@NotNull java.lang.String path, T defaultValue, @NotNull DataFunction<java.lang.Object,T> parser)Get the value of the path using a parser function, if the path does not exist, return the default value.<T> Tget(@NotNull java.lang.String path, T defaults, @NotNull java.lang.Class<T> clazz)Get the value of the path for specific type, if the path does not exist, return the default value.booleangetBoolean(@NotNull java.lang.String path)Get the value as aBooleanfrom the specified path.@Nullable java.lang.BooleangetBoolean(@NotNull java.lang.String path, @Nullable java.lang.Boolean def)Get the value as aBooleanfrom the specified path.@Nullable java.lang.BytegetByte(@NotNull java.lang.String path)Get the value as aBytefrom the specified path.@Nullable java.lang.BytegetByte(@NotNull java.lang.String path, @Nullable java.lang.Byte def)Get the value as aBytefrom the specified path.@NotNull java.util.List<java.lang.Byte>getByteList(@NotNull java.lang.String path)Get a list of bytes from the section@Nullable java.lang.CharactergetChar(@NotNull java.lang.String path)Get the value as aCharacterfrom the specified path.@Nullable java.lang.CharactergetChar(@NotNull java.lang.String path, @Nullable java.lang.Character def)Get the value as aCharacterfrom the specified path.@NotNull java.util.List<java.lang.Character>getCharList(@NotNull java.lang.String path)Get a list of char from the section<T,C extends java.util.Collection<T>>
CgetCollection(@NotNull java.lang.String path, @NotNull java.util.function.Supplier<C> constructor, @NotNull DataFunction<java.lang.Object,T> parser)Get the specific type of collection from the section.@Nullable java.lang.DoublegetDouble(@NotNull java.lang.String path)Get the value as aDoublefrom the specified path.@Nullable java.lang.DoublegetDouble(@NotNull java.lang.String path, @Nullable java.lang.Double def)Get the value as aDoublefrom the specified path.@NotNull java.util.List<java.lang.Double>getDoubleList(@NotNull java.lang.String path)Get a list of double from the section@Nullable java.lang.FloatgetFloat(@NotNull java.lang.String path)Get the value as aFloatfrom the specified path.@Nullable java.lang.FloatgetFloat(@NotNull java.lang.String path, @Nullable java.lang.Float def)Get the value as aFloatfrom the specified path.@NotNull java.util.List<java.lang.Float>getFloatList(@NotNull java.lang.String path)Get a list of floats from the section@Nullable java.lang.IntegergetInt(@NotNull java.lang.String path)Get the value as aIntegerfrom the specified path.@Nullable java.lang.IntegergetInt(@NotNull java.lang.String path, @Nullable java.lang.Integer def)Get the value as aIntegerfrom the specified path.@NotNull java.util.List<java.lang.Integer>getIntegerList(@NotNull java.lang.String path)Get a list of integer from the section@NotNull @UnmodifiableView java.util.Set<java.lang.String>getKeys(boolean deep)Gets a set containing all keys in this section.@Nullable java.util.List<?>getList(@NotNull java.lang.String path)Get the value as aListfrom the specified path.<V> @NotNull java.util.List<V>getList(@NotNull java.lang.String path, @NotNull DataFunction<java.lang.Object,V> parser)Get a list of values from the section@Nullable java.lang.LonggetLong(@NotNull java.lang.String path)Get the value as aLongfrom the specified path.@Nullable java.lang.LonggetLong(@NotNull java.lang.String path, @Nullable java.lang.Long def)Get the value as aLongfrom the specified path.@NotNull java.util.List<java.lang.Long>getLongList(@NotNull java.lang.String path)Get a list of long from the section@Nullable ConfigureSectiongetSection(@NotNull java.lang.String path)Get the value as aConfigureSectionfrom the specified path.@Nullable java.lang.ShortgetShort(@NotNull java.lang.String path)Get the value as aShortfrom the specified path.@Nullable java.lang.ShortgetShort(@NotNull java.lang.String path, @Nullable java.lang.Short def)Get the value as aShortfrom the specified path.@Nullable java.lang.StringgetString(@NotNull java.lang.String path)Get the value as aStringfrom the specified path.@Nullable java.lang.StringgetString(@NotNull java.lang.String path, @Nullable java.lang.String def)Get the value as aStringfrom the specified path.@NotNull java.util.List<java.lang.String>getStringList(@NotNull java.lang.String path)Get a list of strings from the section@NotNull @UnmodifiableView java.util.Map<java.lang.String,java.lang.Object>getValues(boolean deep)Gets a set containing all values in this section.inthashCode()booleanisBoolean(@NotNull java.lang.String path)Predicate the value of given path is aBoolean.@Nullable java.lang.BooleanisByte(@NotNull java.lang.String path)Predicate the value of given path is aByte.booleanisChar(@NotNull java.lang.String path)Predicate the value of given path is aCharacter.booleanisDouble(@NotNull java.lang.String path)Predicate the value of given path is aDouble.booleanisEmpty()Gets if this section is empty.booleanisFloat(@NotNull java.lang.String path)Predicate the value of given path is aFloat.booleanisInt(@NotNull java.lang.String path)Predicate the value of given path is aInteger.booleanisList(@NotNull java.lang.String path)Predicate the value of given path is aList.booleanisLong(@NotNull java.lang.String path)Predicate the value of given path is aLong.FbooleanisRoot()Gets if this section is a root section.booleanisSection(@NotNull java.lang.String path)Predicate the value of given path is aConfigureSection.booleanisShort(@NotNull java.lang.String path)Predicate the value of given path is aShort.booleanisString(@NotNull java.lang.String path)Predicate the value of given path is aString.<T> booleanisType(@NotNull java.lang.String path, @NotNull java.lang.Class<T> typeClass)Predicate the value of given path is specific type.@NotNull @UnmodifiableView java.util.Set<java.lang.String>keys()Gets a set containing all primary keys in this section.static ImmutableSectionof(@NotNull ConfigureSection section)@Nullable ImmutableSectionparent()Gets the parent section of this section.@NotNull java.lang.Stringpath()Get the current section's path fromConfigureSection.parent()of this section.charpathSeparator()Get the path separator for the section.voidremove(@NotNull java.lang.String path)Removes the value at the given path.voidset(@NotNull java.lang.String path, @Nullable java.lang.Object value)Sets the value at the given path.java.util.stream.Stream<java.util.Map.Entry<java.lang.String,java.lang.Object>>stream()Create a stream of all values in this section.@NotNull java.util.stream.Stream<?>stream(@NotNull java.lang.String path)Get the specific type of steam from the section.<T> @NotNull java.util.stream.Stream<T>stream(@NotNull java.lang.String path, @NotNull java.util.function.Function<java.lang.Object,T> parser)Get the specific type of steam from the section.@NotNull @UnmodifiableView java.util.Map<java.lang.String,java.lang.Object>values()Gets a set containing all key-values in this section.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cc.carm.lib.configuration.source.section.ConfigureSection
computeSection, computeSection, computeSection, computeSection, createSection, createSection, createSection, fullPath, size
-
-
-
-
Field Detail
-
parent
@Nullable protected final @Nullable ImmutableSection parent
-
raw
@NotNull protected final @NotNull ConfigureSection raw
-
-
Method Detail
-
of
public static ImmutableSection of(@NotNull @NotNull ConfigureSection section)
-
parent
@Nullable public @Nullable ImmutableSection 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
@NotNull public @NotNull java.lang.String 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
@NotNull public @NotNull @UnmodifiableView java.util.Map<java.lang.String,java.lang.Object> getValues(boolean deep)
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.
-
set
public void set(@NotNull @NotNull java.lang.String path, @Nullable @Nullable java.lang.Object value)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
public void remove(@NotNull @NotNull java.lang.String path)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 ImmutableSection createSection(@NotNull @NotNull java.lang.String path, @NotNull @NotNull java.util.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 interfaceConfigureSectiondata- The data to be used to create section.- Returns:
- Newly created section
-
get
@Nullable public @Nullable java.lang.Object get(@NotNull @NotNull java.lang.String path)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.
-
getSection
@Nullable public @Nullable ConfigureSection getSection(@NotNull @NotNull java.lang.String path)
Description copied from interface:ConfigureSectionGet the value as aConfigureSectionfrom the specified path.- Specified by:
getSectionin interfaceConfigureSection- Parameters:
path- The path to get the section.- Returns:
- The section if the path exists and is a section, otherwise null.
-
pathSeparator
public char pathSeparator()
Description copied from interface:ConfigureSectionGet the path separator for the section.- Specified by:
pathSeparatorin interfaceConfigureSection- Returns:
- The path separator
-
isRoot
public boolean isRoot()
Description copied from interface:ConfigureSectionGets if this section is a root section.- Specified by:
isRootin interfaceConfigureSection- Returns:
- True if this section is a root section, false otherwise.
-
isEmpty
public boolean isEmpty()
Description copied from interface:ConfigureSectionGets if this section is empty.- Specified by:
isEmptyin interfaceConfigureSection- Returns:
- True if this section is empty, false otherwise.
-
getKeys
@NotNull public @NotNull @UnmodifiableView java.util.Set<java.lang.String> getKeys(boolean deep)
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.
-
keys
@NotNull public @NotNull @UnmodifiableView java.util.Set<java.lang.String> keys()
Description copied from interface:ConfigureSectionGets a set containing all primary keys in this section.- Specified by:
keysin interfaceConfigureSection- Returns:
- Set of keys contained within this Section.
-
values
@NotNull public @NotNull @UnmodifiableView java.util.Map<java.lang.String,java.lang.Object> values()
Description copied from interface:ConfigureSectionGets a set containing all key-values in this section.- Specified by:
valuesin interfaceConfigureSection- Returns:
- Map of data values contained within this Section.
- See Also:
ConfigureSection.getValues(boolean)
-
asMap
@NotNull public @NotNull @UnmodifiableView java.util.Map<java.lang.String,java.lang.Object> 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.
-
stream
public java.util.stream.Stream<java.util.Map.Entry<java.lang.String,java.lang.Object>> stream()
Description copied from interface:ConfigureSectionCreate a stream of all values in this section.- Specified by:
streamin interfaceConfigureSection- Returns:
- Stream of all values in this section.
-
forEach
public void forEach(@NotNull @NotNull java.util.function.BiConsumer<java.lang.String,java.lang.Object> action)Description copied from interface:ConfigureSectionIterates over all key-values in this section (include child sections)- Specified by:
forEachin interfaceConfigureSection- Parameters:
action- The action to apply to each key.
-
contains
public boolean contains(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionCheck if the given path is present.Path separator depends on holder's
StandardOptions.PATH_SEPARATOR- Specified by:
containsin interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present, false otherwise.
-
containsValue
public boolean containsValue(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionCheck if the value of given path is present.Path separator depends on holder's
StandardOptions.PATH_SEPARATOR- Specified by:
containsValuein interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present, false otherwise.
-
isType
public <T> boolean isType(@NotNull @NotNull java.lang.String path, @NotNull @NotNull java.lang.Class<T> typeClass)Description copied from interface:ConfigureSectionPredicate the value of given path is specific type.- Specified by:
isTypein interfaceConfigureSection- Type Parameters:
T- The type to check.- Parameters:
path- The path to check.typeClass- The type's class- Returns:
- True if the value is present and is the correct type, false otherwise.
-
isList
public boolean isList(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aList.- Specified by:
isListin interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is a list, false otherwise.
-
getList
@Nullable public @Nullable java.util.List<?> getList(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the value as aListfrom the specified path.- Specified by:
getListin interfaceConfigureSection- Parameters:
path- The path to get theList.- Returns:
- The list if the path exists and is a list, otherwise null.
-
isSection
public boolean isSection(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aConfigureSection.- Specified by:
isSectionin interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is a section, false otherwise.
-
get
@Nullable public <T> T get(@NotNull @NotNull java.lang.String path, @NotNull @NotNull java.lang.Class<T> type)Description copied from interface:ConfigureSectionGet the value of the path for specific type, if the path does not exist, return null.- Specified by:
getin interfaceConfigureSection- Type Parameters:
T- The type of the value- Parameters:
path- The path to get the value from.type- The type class of the value- Returns:
- The value at the path, or the default value if not found.
-
get
@Nullable public <T> T get(@NotNull @NotNull java.lang.String path, @NotNull @NotNull DataFunction<@Nullable java.lang.Object,T> parser)Description copied from interface:ConfigureSectionGet the value of the path using a parser function, if the path does not exist, return NULL.- Specified by:
getin interfaceConfigureSection- Type Parameters:
T- The type of the value- Parameters:
path- The path to get the value from.parser- The function to parse the value- Returns:
- The value at the path, or null if not found.
-
get
@Nullable public <T> T get(@NotNull @NotNull java.lang.String path, T defaults, @NotNull @NotNull java.lang.Class<T> clazz)Description copied from interface:ConfigureSectionGet the value of the path for specific type, if the path does not exist, return the default value.- Specified by:
getin interfaceConfigureSection- Type Parameters:
T- The type of the value- Parameters:
path- The path to get the value from.defaults- The default value to return if the path does not exist.clazz- The type class of the value- Returns:
- The value at the path, or the default value if not found.
-
get
@Nullable public <T> T get(@NotNull @NotNull java.lang.String path, T defaultValue, @NotNull @NotNull DataFunction<java.lang.Object,T> parser)Description copied from interface:ConfigureSectionGet the value of the path using a parser function, if the path does not exist, return the default value.- Specified by:
getin interfaceConfigureSection- Type Parameters:
T- The type of the value- Parameters:
path- The path to get the value from.defaultValue- The default value to return if the path does not exist.parser- The function to parse the value- Returns:
- The value at the path, or the default value if not found.
-
isBoolean
public boolean isBoolean(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aBoolean.- Specified by:
isBooleanin interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is a boolean, false otherwise.
-
getBoolean
public boolean getBoolean(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the value as aBooleanfrom the specified path.- Specified by:
getBooleanin interfaceConfigureSection- Parameters:
path- The path to get the boolean.- Returns:
- The boolean if the path exists and is a boolean, otherwise false.
-
getBoolean
@Nullable public @Nullable java.lang.Boolean getBoolean(@NotNull @NotNull java.lang.String path, @Nullable @Nullable java.lang.Boolean def)Description copied from interface:ConfigureSectionGet the value as aBooleanfrom the specified path.- Specified by:
getBooleanin interfaceConfigureSection- Parameters:
path- The path to get the boolean.def- The default value to return if the path does not exist.- Returns:
- The boolean if the path exists and is a boolean, otherwise the default value.
-
isByte
@Nullable public @Nullable java.lang.Boolean isByte(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aByte.- Specified by:
isBytein interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is a byte, false otherwise.
-
getByte
@Nullable public @Nullable java.lang.Byte getByte(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the value as aBytefrom the specified path.- Specified by:
getBytein interfaceConfigureSection- Parameters:
path- The path to get the byte.- Returns:
- The byte if the path exists and is a byte, otherwise 0.
-
getByte
@Nullable public @Nullable java.lang.Byte getByte(@NotNull @NotNull java.lang.String path, @Nullable @Nullable java.lang.Byte def)Description copied from interface:ConfigureSectionGet the value as aBytefrom the specified path.- Specified by:
getBytein interfaceConfigureSection- Parameters:
path- The path to get the byte.def- The default value to return if the path does not exist.- Returns:
- The byte if the path exists and is a byte, otherwise the default value.
-
isShort
public boolean isShort(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aShort.- Specified by:
isShortin interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is a short, false otherwise.
-
getShort
@Nullable public @Nullable java.lang.Short getShort(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the value as aShortfrom the specified path.- Specified by:
getShortin interfaceConfigureSection- Parameters:
path- The path to get the short.- Returns:
- The short if the path exists and is a short, otherwise 0.
-
getShort
@Nullable public @Nullable java.lang.Short getShort(@NotNull @NotNull java.lang.String path, @Nullable @Nullable java.lang.Short def)Description copied from interface:ConfigureSectionGet the value as aShortfrom the specified path.- Specified by:
getShortin interfaceConfigureSection- Parameters:
path- The path to get the short.def- The default value to return if the path does not exist.- Returns:
- The short if the path exists and is a short, otherwise the default value.
-
isInt
public boolean isInt(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aInteger.- Specified by:
isIntin interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is an int, false otherwise.
-
getInt
@Nullable public @Nullable java.lang.Integer getInt(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the value as aIntegerfrom the specified path.- Specified by:
getIntin interfaceConfigureSection- Parameters:
path- The path to get the int.- Returns:
- The int if the path exists and is an int, otherwise 0.
-
getInt
@Nullable public @Nullable java.lang.Integer getInt(@NotNull @NotNull java.lang.String path, @Nullable @Nullable java.lang.Integer def)Description copied from interface:ConfigureSectionGet the value as aIntegerfrom the specified path.- Specified by:
getIntin interfaceConfigureSection- Parameters:
path- The path to get the int.def- The default value to return if the path does not exist.- Returns:
- The int if the path exists and is an int, otherwise the default value.
-
isLong
public boolean isLong(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aLong.F- Specified by:
isLongin interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is a long, false otherwise.
-
getLong
@Nullable public @Nullable java.lang.Long getLong(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the value as aLongfrom the specified path.- Specified by:
getLongin interfaceConfigureSection- Parameters:
path- The path to get the long.- Returns:
- The long if the path exists and is a long, otherwise 0.
-
getLong
@Nullable public @Nullable java.lang.Long getLong(@NotNull @NotNull java.lang.String path, @Nullable @Nullable java.lang.Long def)Description copied from interface:ConfigureSectionGet the value as aLongfrom the specified path.- Specified by:
getLongin interfaceConfigureSection- Parameters:
path- The path to get the long.def- The default value to return if the path does not exist.- Returns:
- The long if the path exists and is a long, otherwise the default value.
-
isFloat
public boolean isFloat(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aFloat.- Specified by:
isFloatin interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is a float, false otherwise.
-
getFloat
@Nullable public @Nullable java.lang.Float getFloat(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the value as aFloatfrom the specified path.- Specified by:
getFloatin interfaceConfigureSection- Parameters:
path- The path to get the float.- Returns:
- The float if the path exists and is a float, otherwise 0.
-
getFloat
@Nullable public @Nullable java.lang.Float getFloat(@NotNull @NotNull java.lang.String path, @Nullable @Nullable java.lang.Float def)Description copied from interface:ConfigureSectionGet the value as aFloatfrom the specified path.- Specified by:
getFloatin interfaceConfigureSection- Parameters:
path- The path to get the float.def- The default value to return if the path does not exist.- Returns:
- The float if the path exists and is a float, otherwise the default value.
-
isDouble
public boolean isDouble(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aDouble.- Specified by:
isDoublein interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is a double, false otherwise.
-
getDouble
@Nullable public @Nullable java.lang.Double getDouble(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the value as aDoublefrom the specified path.- Specified by:
getDoublein interfaceConfigureSection- Parameters:
path- The path to get the double.- Returns:
- The double if the path exists and is a double, otherwise 0.
-
getDouble
@Nullable public @Nullable java.lang.Double getDouble(@NotNull @NotNull java.lang.String path, @Nullable @Nullable java.lang.Double def)Description copied from interface:ConfigureSectionGet the value as aDoublefrom the specified path.- Specified by:
getDoublein interfaceConfigureSection- Parameters:
path- The path to get the double.def- The default value to return if the path does not exist.- Returns:
- The double if the path exists and is a double, otherwise the default value.
-
isChar
public boolean isChar(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aCharacter.- Specified by:
isCharin interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is a char, false otherwise.
-
getChar
@Nullable public @Nullable java.lang.Character getChar(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the value as aCharacterfrom the specified path.- Specified by:
getCharin interfaceConfigureSection- Parameters:
path- The path to get the char.- Returns:
- The char if the path exists and is a char, otherwise null.
-
getChar
@Nullable public @Nullable java.lang.Character getChar(@NotNull @NotNull java.lang.String path, @Nullable @Nullable java.lang.Character def)Description copied from interface:ConfigureSectionGet the value as aCharacterfrom the specified path.- Specified by:
getCharin interfaceConfigureSection- Parameters:
path- The path to get the char.def- The default value to return if the path does not exist.- Returns:
- The char if the path exists and is a char, otherwise the default value.
-
isString
public boolean isString(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionPredicate the value of given path is aString.- Specified by:
isStringin interfaceConfigureSection- Parameters:
path- The path to check.- Returns:
- True if the value is present and is a string, false otherwise.
-
getString
@Nullable public @Nullable java.lang.String getString(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the value as aStringfrom the specified path.- Specified by:
getStringin interfaceConfigureSection- Parameters:
path- The path to get the string.- Returns:
- The string if the path exists and is a string, otherwise null.
-
getString
@Nullable public @Nullable java.lang.String getString(@NotNull @NotNull java.lang.String path, @Nullable @Nullable java.lang.String def)Description copied from interface:ConfigureSectionGet the value as aStringfrom the specified path.- Specified by:
getStringin interfaceConfigureSection- Parameters:
path- The path to get the string.def- The default value to return if the path does not exist.- Returns:
- The string if the path exists and is a string, otherwise the default value.
-
getList
@NotNull public <V> @NotNull java.util.List<V> getList(@NotNull @NotNull java.lang.String path, @NotNull @NotNull DataFunction<java.lang.Object,V> parser)Description copied from interface:ConfigureSectionGet a list of values from the sectionIf the path does not exist, an empty list will be returned
Any changes please useConfigureSection.set(String, Object)after changes- Specified by:
getListin interfaceConfigureSection- Type Parameters:
V- The type of the values- Parameters:
path- The path to get the list fromparser- The function to parse the values- Returns:
- The list of values
-
getStringList
@NotNull public @NotNull java.util.List<java.lang.String> getStringList(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet a list of strings from the sectionLimitations see
ConfigureSection.getList(String, DataFunction)- Specified by:
getStringListin interfaceConfigureSection- Parameters:
path- The path to get the list from- Returns:
- The list of strings
-
getIntegerList
@NotNull public @NotNull java.util.List<java.lang.Integer> getIntegerList(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet a list of integer from the sectionLimitations see
ConfigureSection.getList(String, DataFunction)- Specified by:
getIntegerListin interfaceConfigureSection- Parameters:
path- The path to get the list from- Returns:
- The list of int values
-
getLongList
@NotNull public @NotNull java.util.List<java.lang.Long> getLongList(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet a list of long from the sectionLimitations see
ConfigureSection.getList(String, DataFunction)- Specified by:
getLongListin interfaceConfigureSection- Parameters:
path- The path to get the list from- Returns:
- The list of long values
-
getDoubleList
@NotNull public @NotNull java.util.List<java.lang.Double> getDoubleList(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet a list of double from the sectionLimitations see
ConfigureSection.getList(String, DataFunction)- Specified by:
getDoubleListin interfaceConfigureSection- Parameters:
path- The path to get the list from- Returns:
- The list of doubles
-
getFloatList
@NotNull public @NotNull java.util.List<java.lang.Float> getFloatList(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet a list of floats from the sectionLimitations see
ConfigureSection.getList(String, DataFunction)- Specified by:
getFloatListin interfaceConfigureSection- Parameters:
path- The path to get the list from- Returns:
- The list of floats
-
getByteList
@NotNull public @NotNull java.util.List<java.lang.Byte> getByteList(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet a list of bytes from the sectionLimitations see
ConfigureSection.getList(String, DataFunction)- Specified by:
getByteListin interfaceConfigureSection- Parameters:
path- The path to get the list from- Returns:
- The list of bytes
-
getCharList
@NotNull public @NotNull java.util.List<java.lang.Character> getCharList(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet a list of char from the sectionLimitations see
ConfigureSection.getList(String, DataFunction)- Specified by:
getCharListin interfaceConfigureSection- Parameters:
path- The path to get the list from- Returns:
- The list of char
-
getCollection
@NotNull public <T,C extends java.util.Collection<T>> C getCollection(@NotNull @NotNull java.lang.String path, @NotNull @NotNull java.util.function.Supplier<C> constructor, @NotNull @NotNull DataFunction<java.lang.Object,T> parser)Description copied from interface:ConfigureSectionGet the specific type of collection from the section.- Specified by:
getCollectionin interfaceConfigureSection- Type Parameters:
T- The type of the valuesC- The type of the collection- Parameters:
path- The path to get the collection fromconstructor- The constructor of the collectionparser- The function to parse the values- Returns:
- The collection of values
-
stream
@NotNull public @NotNull java.util.stream.Stream<?> stream(@NotNull @NotNull java.lang.String path)Description copied from interface:ConfigureSectionGet the specific type of steam from the section.- Specified by:
streamin interfaceConfigureSection- Parameters:
path- The path to get the stream from- Returns:
- The stream of values
-
stream
@NotNull public <T> @NotNull java.util.stream.Stream<T> stream(@NotNull @NotNull java.lang.String path, @NotNull @NotNull java.util.function.Function<java.lang.Object,T> parser)Description copied from interface:ConfigureSectionGet the specific type of steam from the section.- Specified by:
streamin interfaceConfigureSection- Type Parameters:
T- The type of the values- Parameters:
path- The path to get the stream fromparser- The function to parse the values- Returns:
- The stream of values
-
childPath
public java.lang.String childPath(java.lang.String path)
- Specified by:
childPathin interfaceConfigureSection
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-