Package fr.maxlego08.menu.api.utils
Interface MapConfiguration
- All Known Implementing Classes:
TypedMapAccessor,YamlConfigurationAccessor
public interface MapConfiguration
This interface provides typed access to a map of key-value pairs, allowing retrieval
of values of different types with or without default values if the key is not present in the map.
-
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.
-
Method Details
-
getString
Retrieves a string value from the map based on the provided key.- 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
Retrieves a string value from the map based on the provided key. If the key is not present, returns the specified default value.- 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
Retrieves an integer value from the map based on the provided key.- 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
Retrieves an integer value from the map based on the provided key. If the key is not present, returns the specified default value.- 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
Retrieves a long value from the map based on the provided key.- 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
Retrieves a long value from the map based on the provided key. If the key is not present, returns the specified default value.- 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
Retrieves a list of strings from the map based on the provided key.- 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
Retrieves a list of strings from the map based on the provided key. If the key is not present, returns the specified default value.- 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
Retrieves a list of integers from the map based on the provided key.- 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
Retrieves a list of integers from the map based on the provided key. If the key is not present, returns the specified default value.- 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
Retrieves a boolean value from the map based on the provided key.- 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
Retrieves a boolean value from the map based on the provided key. If the key is not present, returns the specified default value.- 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
Retrieves a double value from the map based on the provided key.- 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
Retrieves a double value from the map based on the provided key. If the key is not present, returns the specified default value.- 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
Retrieves an object from the map based on the provided key.- Parameters:
key- The key to retrieve the value.- Returns:
- The object associated with the key or null if the key is not present.
-
getObject
Retrieves an object from the map based on the provided key.- 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
Retrieves a float value from the map based on the provided key.- 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
Retrieves a float value from the map based on the provided key. If the key is not present, returns the specified default value.- 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
-
contains
-