Class Config
java.lang.Object
org.bukkit.configuration.MemorySection
org.bukkit.configuration.MemoryConfiguration
org.bukkit.configuration.file.FileConfiguration
org.bukkit.configuration.file.YamlConfiguration
com.mclds.plugins.customplugin.utils.Config
- All Implemented Interfaces:
org.bukkit.configuration.Configuration,org.bukkit.configuration.ConfigurationSection
public class Config
extends org.bukkit.configuration.file.YamlConfiguration
-
Field Summary
Fields inherited from class org.bukkit.configuration.file.YamlConfiguration
BLANK_CONFIG, COMMENT_PREFIXFields inherited from class org.bukkit.configuration.MemoryConfiguration
defaults, optionsFields inherited from class org.bukkit.configuration.MemorySection
map -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMap()获取整个配置文件,如果为空则返回空map获取一个配置文件的某个路径的值,如果不存在,返回空mapstatic <T,R> R static <T> voidstatic void判断一个对象是否是map,如果是,执行ifIsMapstatic <T> List<T> 获取一个list,如果 listLike 是 null 或者类型不匹配 ,返回一个空liststatic <T> List<T> 获取一个list,如果 listLike 是null,返回默认值获取一个map,如果 mapLike 是null,返回一个空map获取一个map,如果 mapLike 是 null,返回默认值 如果 map 值不是 valueType 类型,返回默认值获取一个map,如果 mapLike 是null,返回默认值static BooleanvalueBoolean(Object baseValueLike, Boolean defaultValue) static DoublevalueDouble(Object baseValueLike, Double defaultValue) static FloatvalueFloat(Object baseValueLike, Float defaultValue) static IntegervalueInteger(Object baseValueLike, Integer defaultValue) static Longstatic StringvalueString(Object baseValueLike, String defaultValue) Methods inherited from class org.bukkit.configuration.file.YamlConfiguration
loadConfiguration, loadConfiguration, loadFromString, options, saveToStringMethods inherited from class org.bukkit.configuration.file.FileConfiguration
buildHeader, load, load, load, save, saveMethods inherited from class org.bukkit.configuration.MemoryConfiguration
addDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultsMethods inherited from class org.bukkit.configuration.MemorySection
contains, contains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getConfigurationSection, getCurrentPath, getDefault, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isPrimitiveWrapper, isSet, isString, isVector, mapChildrenKeys, mapChildrenValues, set, setComments, setInlineComments, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.configuration.ConfigurationSection
contains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getComponent, getComponent, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRichMessage, getRichMessage, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isSet, isString, isVector, set, setComments, setComponent, setInlineComments, setRichMessage
-
Constructor Details
-
Config
public Config()
-
-
Method Details
-
getMap
获取整个配置文件,如果为空则返回空map -
getMap
获取一个配置文件的某个路径的值,如果不存在,返回空map -
isMap
判断一个对象是否是map,如果是,执行ifIsMap -
map
获取一个map,如果 mapLike 是null,返回一个空map -
map
public static Map<String,Object> map(@Nullable @Nullable Object mapLike, Map<String, Object> defaultValue) 获取一个map,如果 mapLike 是null,返回默认值 -
map
-
map
public static <T> Map<String,T> map(@Nullable @Nullable Object mapLike, Class<T> valueType, Map<String, T> defaultValue) 获取一个map,如果 mapLike 是 null,返回默认值 如果 map 值不是 valueType 类型,返回默认值 -
isList
-
listMap
-
listMap
-
list
获取一个list,如果 listLike 是 null 或者类型不匹配 ,返回一个空list- Parameters:
listLike- 列表type- 列表元素的类型
-
list
获取一个list,如果 listLike 是null,返回默认值- Parameters:
listLike- 列表type- 列表元素的类型defaultValue- 默认值
-
valueInteger
-
valueDouble
-
valueFloat
-
valueLong
-
valueBoolean
-
valueString
-
handle
-