Class MurmelMemory
java.lang.Object
de.murmelmeister.murmelapi.configuration.MurmelMemory
- Direct Known Subclasses:
MurmelConfiguration
MurmelMemory class provides a storage mechanism for key-value pairs.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the value associated with the specified key.<T> TRetrieves the value associated with the specified key if it is an instance of the specified type.getBoolean(String key) Retrieves the Boolean value associated with the specified key.getBooleanList(String key) Retrieves a list of Boolean values associated with the specified key.Retrieves the Byte value associated with the specified key.getByteList(String key) Retrieves a list of Byte values associated with the specified key.getCharacter(String key) Retrieves the Character value associated with the specified key.getCharacterList(String key) Retrieves a list of Character values associated with the specified key.Retrieves the Double value associated with the specified key.getDoubleList(String key) Retrieves a list of Double values associated with the specified key.Retrieves the Float value associated with the specified key if it exists and is of type Float.getFloatList(String key) Retrieves a list of Float values associated with the specified key.getInteger(String key) Retrieves the Integer value associated with the specified key if it exists and is of type Integer.getIntegerList(String key) Retrieves a list of Integer values associated with the specified key.List<?> Retrieves a list associated with the specified key.Retrieves the Long value associated with the specified key.getLongList(String key) Retrieves a list of Long values associated with the specified key.<T> Optional<T> getOptional(String key, Class<T> type) Retrieves an Optional containing the value associated with the specified key if it is an instance of the specified type.Retrieves the Short value associated with the specified key.getShortList(String key) Retrieves a list of Short values associated with the specified key.Retrieves the String value associated with the specified key.getStringList(String key) Retrieves a list of String values associated with the specified key.voidStores a key-value pair in the data map.
-
Field Details
-
data
-
-
Constructor Details
-
MurmelMemory
public MurmelMemory()
-
-
Method Details
-
set
Stores a key-value pair in the data map.- Parameters:
key- the key with which the specified value is to be associatedvalue- the value to be associated with the specified key
-
get
Retrieves the value associated with the specified key.- Parameters:
key- the key whose associated value is to be returned- Returns:
- the value associated with the specified key, or null if no value is found
-
getOptional
Retrieves an Optional containing the value associated with the specified key if it is an instance of the specified type.- Parameters:
key- the key whose associated value is to be returnedtype- the class of the type to which the value should be cast- Returns:
- an Optional containing the value if it exists and is of the specified type, otherwise an empty Optional
-
get
Retrieves the value associated with the specified key if it is an instance of the specified type.- Parameters:
key- the key whose associated value is to be returnedtype- the class of the type to which the value should be cast- Returns:
- the value associated with the specified key if it exists and is of the specified type, otherwise null
-
getBoolean
Retrieves the Boolean value associated with the specified key.- Parameters:
key- the key whose associated Boolean value is to be returned- Returns:
- the Boolean value associated with the specified key if it exists and is of type Boolean, otherwise null
-
getByte
Retrieves the Byte value associated with the specified key.- Parameters:
key- the key whose associated Byte value is to be returned- Returns:
- the Byte value associated with the specified key if it exists and is of type Byte, otherwise null
-
getShort
Retrieves the Short value associated with the specified key.- Parameters:
key- the key whose associated Short value is to be returned- Returns:
- the Short value associated with the specified key if it exists and is of type Short, otherwise null
-
getInteger
Retrieves the Integer value associated with the specified key if it exists and is of type Integer.- Parameters:
key- the key whose associated Integer value is to be returned- Returns:
- the Integer value associated with the specified key if it exists and is of type Integer, otherwise null
-
getLong
Retrieves the Long value associated with the specified key.- Parameters:
key- the key whose associated Long value is to be returned- Returns:
- the Long value associated with the specified key if it exists and is of type Long, otherwise null
-
getFloat
Retrieves the Float value associated with the specified key if it exists and is of type Float.- Parameters:
key- the key whose associated Float value is to be returned- Returns:
- the Float value associated with the specified key if it exists and is of type Float, otherwise null
-
getDouble
Retrieves the Double value associated with the specified key.- Parameters:
key- the key whose associated Double value is to be returned- Returns:
- the Double value associated with the specified key if it exists and is of type Double, otherwise null
-
getCharacter
Retrieves the Character value associated with the specified key.- Parameters:
key- the key whose associated Character value is to be returned- Returns:
- the Character value associated with the specified key if it exists and is of type Character, otherwise null
-
getString
Retrieves the String value associated with the specified key.- Parameters:
key- the key whose associated String value is to be returned- Returns:
- the String value associated with the specified key if it exists and is of type String, otherwise null
-
getList
Retrieves a list associated with the specified key.- Parameters:
key- the key whose associated list is to be returned- Returns:
- the list associated with the specified key if it exists and is of type List, otherwise null
-
getBooleanList
Retrieves a list of Boolean values associated with the specified key.- Parameters:
key- the key whose associated list of Boolean values is to be returned- Returns:
- a list containing Boolean values, or an empty list if no values are found or if the list contains non-Boolean values
-
getByteList
Retrieves a list of Byte values associated with the specified key.- Parameters:
key- the key whose associated list of Byte values is to be returned- Returns:
- a list containing Byte values, or an empty list if no values are found or if the list contains non-Byte values
-
getShortList
Retrieves a list of Short values associated with the specified key.- Parameters:
key- the key whose associated list of Short values is to be returned- Returns:
- a list containing Short values, or an empty list if no values are found or if the list contains non-Short values
-
getIntegerList
Retrieves a list of Integer values associated with the specified key.- Parameters:
key- the key whose associated list of Integer values is to be returned- Returns:
- a list containing Integer values, or an empty list if no values are found or if the list contains non-Integer values
-
getLongList
Retrieves a list of Long values associated with the specified key.- Parameters:
key- the key whose associated list of Long values is to be returned- Returns:
- a list containing Long values, or an empty list if no values are found or if the list contains non-Long values
-
getFloatList
Retrieves a list of Float values associated with the specified key.- Parameters:
key- the key whose associated list of Float values is to be returned- Returns:
- a list containing Float values, or an empty list if no values are found or if the list contains non-Float values
-
getDoubleList
Retrieves a list of Double values associated with the specified key.- Parameters:
key- the key whose associated list of Double values is to be returned- Returns:
- a list containing Double values, or an empty list if no values are found or if the list contains non-Double values
-
getCharacterList
Retrieves a list of Character values associated with the specified key.- Parameters:
key- the key whose associated list of Character values is to be returned- Returns:
- a list containing Character values, or an empty list if no values are found or if the list contains non-Character values
-
getStringList
Retrieves a list of String values associated with the specified key.- Parameters:
key- the key whose associated list of String values is to be returned- Returns:
- a list containing String values, or an empty list if no values are found or if the list contains non-String values
-