Class StringMapPairedDataMemory
java.lang.Object
me.a8kj.config.template.memory.impl.StringMapPairedDataMemory
- All Implemented Interfaces:
DataMemory<String>,PairedDataMemory<String>
A standard string-keyed implementation of
PairedDataMemory.
This class provides a robust memory storage using HashMap, tailored for
string-based configuration keys while supporting advanced "paired" retrieval
and placeholder processing.- Since:
- 0.1
- Author:
- a8kj7sea
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all data currently held in memory.booleanChecks if the memory contains a specific key.Retrieves a raw object from memory by its key.booleangetBoolean(String key, boolean defaultValue) Retrieves a value as a boolean.doubleRetrieves a value as a double.intRetrieves a value as an integer.Retrieves a set of keys under a specific path.Retrieves a value as aString.getStringList(String key) Retrieves a list of strings from the specified key.voidSets a value in the memory buffer for the specified key.transform(String text, Replacement... replacements) Processes placeholders in the provided text using the internalReplacementProcessor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.a8kj.config.template.memory.DataMemory
get, getOptional, getProcessor, getString, getStringListMethods inherited from interface me.a8kj.config.template.memory.impl.PairedDataMemory
fetchDetailed
-
Constructor Details
-
StringMapPairedDataMemory
public StringMapPairedDataMemory()
-
-
Method Details
-
set
Description copied from interface:DataMemorySets a value in the memory buffer for the specified key.- Specified by:
setin interfaceDataMemory<String>- Parameters:
key- the key where the value should be stored.value- the object to store.
-
get
Description copied from interface:DataMemoryRetrieves a raw object from memory by its key.- Specified by:
getin interfaceDataMemory<String>- Parameters:
key- the key to lookup.- Returns:
- the stored object, or
nullif not found.
-
getString
Description copied from interface:DataMemoryRetrieves a value as aString.- Specified by:
getStringin interfaceDataMemory<String>- Parameters:
key- the key to lookup.- Returns:
- the string representation of the value.
-
getInt
Description copied from interface:DataMemoryRetrieves a value as an integer.- Specified by:
getIntin interfaceDataMemory<String>
-
getBoolean
Description copied from interface:DataMemoryRetrieves a value as a boolean.- Specified by:
getBooleanin interfaceDataMemory<String>
-
getDouble
Description copied from interface:DataMemoryRetrieves a value as a double.- Specified by:
getDoublein interfaceDataMemory<String>
-
getStringList
Description copied from interface:DataMemoryRetrieves a list of strings from the specified key.- Specified by:
getStringListin interfaceDataMemory<String>
-
contains
Description copied from interface:DataMemoryChecks if the memory contains a specific key.- Specified by:
containsin interfaceDataMemory<String>
-
getKeys
Description copied from interface:DataMemoryRetrieves a set of keys under a specific path.- Specified by:
getKeysin interfaceDataMemory<String>- Parameters:
path- the parent path.deep- whether to include keys from nested sections.- Returns:
- a set of keys.
-
clear
public void clear()Description copied from interface:DataMemoryClears all data currently held in memory.- Specified by:
clearin interfaceDataMemory<String>
-
transform
Processes placeholders in the provided text using the internalReplacementProcessor.- Specified by:
transformin interfaceDataMemory<String>- Parameters:
text- the template string.replacements- the data points to be replaced.- Returns:
- the processed string.
-