Package fr.maxlego08.menu.api.utils
Class YamlConfigurationAccessor
java.lang.Object
fr.maxlego08.menu.api.utils.YamlConfigurationAccessor
- All Implemented Interfaces:
MapConfiguration
-
Constructor Summary
ConstructorsConstructorDescriptionYamlConfigurationAccessor(org.bukkit.configuration.file.YamlConfiguration yamlConfig, String path) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleangetBoolean(String key) Retrieves a boolean value from the map based on the provided key.booleangetBoolean(String key, boolean defaultValue) Retrieves a boolean value from the map based on the provided key.doubleRetrieves a double value from the map based on the provided key.doubleRetrieves a double value from the map based on the provided key.floatRetrieves a float value from the map based on the provided key.floatRetrieves a float value from the map based on the provided key.intRetrieves an integer value from the map based on the provided key.intRetrieves an integer value from the map based on the provided key.getIntList(String key) Retrieves a list of integers from the map based on the provided key.getIntList(String key, List<Integer> defaultValue) Retrieves a list of integers from the map based on the provided key.List<?>longRetrieves a long value from the map based on the provided key.longRetrieves a long value from the map based on the provided key.Retrieves an object from the map based on the provided key.Retrieves an object from the map based on the provided key.Retrieves a string value from the map based on the provided key.Retrieves a string value from the map based on the provided key.getStringList(String key) Retrieves a list of strings from the map based on the provided key.getStringList(String key, List<String> defaultValue) Retrieves a list of strings from the map based on the provided key.
-
Constructor Details
-
YamlConfigurationAccessor
public YamlConfigurationAccessor(org.bukkit.configuration.file.YamlConfiguration yamlConfig, String path)
-
-
Method Details
-
getString
Description copied from interface:MapConfigurationRetrieves a string value from the map based on the provided key.- Specified by:
getStringin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.- Returns:
- The string value associated with the key or null if the key is not present.
-
getString
Description copied from interface:MapConfigurationRetrieves a string value from the map based on the provided key. If the key is not present, returns the specified default value.- Specified by:
getStringin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.defaultValue- The default value if the key is not present.- Returns:
- The string value associated with the key or the default value.
-
getInt
Description copied from interface:MapConfigurationRetrieves an integer value from the map based on the provided key.- Specified by:
getIntin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.- Returns:
- The integer value associated with the key or 0 if the key is not present.
-
getInt
Description copied from interface:MapConfigurationRetrieves an integer value from the map based on the provided key. If the key is not present, returns the specified default value.- Specified by:
getIntin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.defaultValue- The default value if the key is not present.- Returns:
- The integer value associated with the key or the default value.
-
getLong
Description copied from interface:MapConfigurationRetrieves a long value from the map based on the provided key.- Specified by:
getLongin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.- Returns:
- The long value associated with the key or 0L if the key is not present.
-
getLong
Description copied from interface:MapConfigurationRetrieves a long value from the map based on the provided key. If the key is not present, returns the specified default value.- Specified by:
getLongin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.defaultValue- The default value if the key is not present.- Returns:
- The long value associated with the key or the default value.
-
getStringList
Description copied from interface:MapConfigurationRetrieves a list of strings from the map based on the provided key.- Specified by:
getStringListin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.- Returns:
- The list of strings associated with the key or an empty list if the key is not present.
-
getStringList
Description copied from interface:MapConfigurationRetrieves a list of strings from the map based on the provided key. If the key is not present, returns the specified default value.- Specified by:
getStringListin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.defaultValue- The default value if the key is not present.- Returns:
- The list of strings associated with the key or the default value.
-
getIntList
Description copied from interface:MapConfigurationRetrieves a list of integers from the map based on the provided key.- Specified by:
getIntListin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.- Returns:
- The list of integers associated with the key or an empty list if the key is not present.
-
getIntList
Description copied from interface:MapConfigurationRetrieves a list of integers from the map based on the provided key. If the key is not present, returns the specified default value.- Specified by:
getIntListin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.defaultValue- The default value if the key is not present.- Returns:
- The list of integers associated with the key or the default value.
-
getBoolean
Description copied from interface:MapConfigurationRetrieves a boolean value from the map based on the provided key.- Specified by:
getBooleanin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.- Returns:
- The boolean value associated with the key or false if the key is not present.
-
getBoolean
Description copied from interface:MapConfigurationRetrieves a boolean value from the map based on the provided key. If the key is not present, returns the specified default value.- Specified by:
getBooleanin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.defaultValue- The default value if the key is not present.- Returns:
- The boolean value associated with the key or the default value.
-
getDouble
Description copied from interface:MapConfigurationRetrieves a double value from the map based on the provided key.- Specified by:
getDoublein interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.- Returns:
- The double value associated with the key or 0.0 if the key is not present.
-
getDouble
Description copied from interface:MapConfigurationRetrieves a double value from the map based on the provided key. If the key is not present, returns the specified default value.- Specified by:
getDoublein interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.defaultValue- The default value if the key is not present.- Returns:
- The double value associated with the key or the default value.
-
getObject
Description copied from interface:MapConfigurationRetrieves an object from the map based on the provided key.- Specified by:
getObjectin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.- Returns:
- The object associated with the key or null if the key is not present.
-
getObject
Description copied from interface:MapConfigurationRetrieves an object from the map based on the provided key.- Specified by:
getObjectin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.defaultValue- The default value if the key is not present.- Returns:
- The object associated with the key or null if the key is not present.
-
getFloat
Description copied from interface:MapConfigurationRetrieves a float value from the map based on the provided key.- Specified by:
getFloatin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.- Returns:
- The float value associated with the key or 0.0f if the key is not present.
-
getFloat
Description copied from interface:MapConfigurationRetrieves a float value from the map based on the provided key. If the key is not present, returns the specified default value.- Specified by:
getFloatin interfaceMapConfiguration- Parameters:
key- The key to retrieve the value.defaultValue- The default value if the key is not present.- Returns:
- The float value associated with the key or the default value.
-
getList
- Specified by:
getListin interfaceMapConfiguration
-
contains
- Specified by:
containsin interfaceMapConfiguration
-