public class YamlConfiguration extends Object implements SectionMap
| 构造器和说明 |
|---|
YamlConfiguration(@Nullable Map<String,Object> values)
Initialize the YamlConfiguration with existed key-value pairs or not
|
| 限定符和类型 | 方法和说明 |
|---|---|
YamlConfigurationSection |
createSection(String key)
Create the section named key
|
<T> T |
get(String key)
Get the value of the key-value pair
|
YamlConfigurationSection |
getSection(String key)
Get the section named key
|
Map<String,Object> |
getValues()
Get all the key-value pairs
|
static YamlConfiguration |
load(InputStream inputStream) |
static YamlConfiguration |
loadFile(File file)
Load the file as a YAML configuration
|
void |
save(File file)
Save the YAML configuration as a file
|
void |
set(String key,
Object value)
Store the key-value pair
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, keys, removepublic static YamlConfiguration loadFile(File file)
file - where to loadpublic static YamlConfiguration load(InputStream inputStream)
public YamlConfigurationSection createSection(String key)
SectionMapcreateSection 在接口中 SectionMapkey - the key of the Sectionpublic void set(String key, Object value)
SectionMapset 在接口中 SectionMapkey - the key of the key-value pairvalue - the value of the key-value pairpublic <T> T get(String key)
SectionMapget 在接口中 SectionMapT - the desired typekey - the key of the key-value pairpublic Map<String,Object> getValues()
SectionMapgetValues 在接口中 SectionMappublic void save(File file)
file - where to savepublic YamlConfigurationSection getSection(String key)
SectionMapgetSection 在接口中 SectionMapkey - the key of the SectionCopyright © 2022. All rights reserved.