-
- 所有已知子接口:
Configuration
- 所有已知实现类:
JsonConfiguration,MemoryConfiguration,MemoryConfigurationSection,PropertiesConfiguration,YamlConfiguration
public interface ConfigurationSection
-
-
方法概要
修饰符和类型 方法 说明 default booleanbooleanV(String path)booleanbooleanV(String path, boolean def)default bytebyteV(String path)bytebyteV(String path, byte def)default charcharV(String path)charcharV(String path, char def)ConfigurationSectionclear()Clear section values.ConfigurationSectionclearSplitter()MakehasCurrentSplitter()return false.@NotNull ConfigurationSectionclone()default @NotNull ConfigurationSectioncopy()Clone current section.default doubledoubleV(String path)doubledoubleV(String path, double def)booleanexists(String path)Check this path has ot no vale.default floatfloatV(String path)floatfloatV(String path, float def)booleanhasCurrentSplitter()Check current context has splitter.default intintV(String path)intintV(String path, int def)@NotNull Set<String>keys()Get the keys of current section.default List<Object>list(String path)List<Object>list(String path, Supplier<List<Object>> def)default longlongV(String path)longlongV(String path, long def)ConfigurationSectionmerge(ConfigurationSection section)Merge other section@NotNull ConfigurationSectionnewContext()Create a new context / Create a Pointer.default Numbernumber(String path)Numbernumber(String path, Number def)ConfigurationSectionparent()Get parent.ConfigurationSectionparent(ConfigurationSection parent)Set parent if absent.charpathSplitter()The splitter using.ConfigurationSectionpathSplitter(char splitter)Change using splitter.ConfigurationSectionremove(String path)Remove a value.default ConfigurationSectionroot()default ConfigurationSectionsection(String path)Same assectionIfExist(String)default ConfigurationSectionsectionIfExist(String path)Get sub section.@NotNull ConfigurationSectionsectionOrCreate(String path)ConfigurationSectionset(String path, Object value)Set the value to ConfigurationSection.default shortshortV(String path)shortshortV(String path, short def)default Stringstring(String path)default Stringstring(String path, String def)Stringstring(String path, Supplier<String> def)default List<String>stringList(String path)List<String>stringList(String path, Supplier<List<String>> def)static StringtoStr(ConfigurationSection cs)booleanuseSplitter()Does current context using splitter.ConfigurationSectionuseSplitter(boolean use)Set current context using splitterdefault Objectvalue(String path)default Objectvalue(String path, Object def)Objectvalue(String path, Supplier<Object> def)Get the value of path.Map<String,Object>values()Get un-editable values.
-
-
-
方法详细资料
-
merge
ConfigurationSection merge(ConfigurationSection section)
Merge other section- 参数:
section- The target.- 返回:
- this.
-
pathSplitter
char pathSplitter()
The splitter using.- 返回:
- The path splitter.
-
pathSplitter
ConfigurationSection pathSplitter(char splitter)
Change using splitter. And makehasCurrentSplitter()return true.Has no effect on
newContext()and parentConfigurationSection- 参数:
splitter- The splitter change.- 返回:
- this.
-
useSplitter
boolean useSplitter()
Does current context using splitter.- 返回:
- true if using splitter.
-
hasCurrentSplitter
boolean hasCurrentSplitter()
Check current context has splitter.- 返回:
- true if parent is null or
clearSplitter()invoked.
-
clearSplitter
ConfigurationSection clearSplitter()
MakehasCurrentSplitter()return false. This method has no effect if parent is null.- 返回:
- this
-
useSplitter
ConfigurationSection useSplitter(boolean use)
Set current context using splitter- 参数:
use- Is using.- 返回:
- this.
-
intV
int intV(String path, int def)
-
intV
default int intV(String path)
-
exists
boolean exists(String path)
Check this path has ot no vale.- 参数:
path- The path checking.- 返回:
- true if path exists.
-
value
Object value(String path, Supplier<Object> def)
Get the value of path. If you want to get value with Target Path Contains splitter. Use this:Object value = section.newContext().useSplitter(false).value(PATH, null);- 参数:
path- The path.def- Default value supplier- 返回:
- The result value.
-
shortV
short shortV(String path, short def)
-
shortV
default short shortV(String path)
-
byteV
byte byteV(String path, byte def)
-
byteV
default byte byteV(String path)
-
charV
default char charV(String path)
-
charV
char charV(String path, char def)
-
floatV
float floatV(String path, float def)
-
floatV
default float floatV(String path)
-
doubleV
double doubleV(String path, double def)
-
doubleV
default double doubleV(String path)
-
booleanV
boolean booleanV(String path, boolean def)
-
booleanV
default boolean booleanV(String path)
-
longV
long longV(String path, long def)
-
longV
default long longV(String path)
-
set
ConfigurationSection set(String path, Object value)
Set the value to ConfigurationSection. This will also affect the values innewContext()WARNING: If root (Configuration) unsupported this value. Then will throw a Exception in
Configuration.store(OutputStream)Configuration.store(java.io.Writer)Configuration.store(File)Configuration.store(Path)- 参数:
path- The path set.value- The value.- 返回:
- this
-
remove
ConfigurationSection remove(String path)
Remove a value.- 参数:
path- The path.- 返回:
- this.
-
sectionIfExist
default ConfigurationSection sectionIfExist(String path)
Get sub section.- 参数:
path- The section path.- 返回:
- Sub Section.(if exist)
-
sectionOrCreate
@NotNull @NotNull ConfigurationSection sectionOrCreate(String path)
-
section
default ConfigurationSection section(String path)
Same assectionIfExist(String)- 参数:
path- The path- 返回:
- Sub Section
-
newContext
@NotNull @NotNull ConfigurationSection newContext()
Create a new context / Create a Pointer.- 返回:
- The pointer created.
-
copy
@NotNull default @NotNull ConfigurationSection copy()
Clone current section. Result no parent.- 返回:
- Cloned Section.
-
clone
@NotNull @NotNull ConfigurationSection clone()
-
clear
ConfigurationSection clear()
Clear section values.- 返回:
- this.
-
toStr
static String toStr(ConfigurationSection cs)
-
parent
ConfigurationSection parent()
Get parent.- 返回:
- The parent
-
root
default ConfigurationSection root()
-
parent
ConfigurationSection parent(ConfigurationSection parent)
Set parent if absent.- 参数:
parent- The target.- 返回:
- this.
-
-