Class MurmelMemory

java.lang.Object
de.murmelmeister.murmelapi.configuration.MurmelMemory
Direct Known Subclasses:
MurmelConfiguration

public abstract class MurmelMemory extends Object
MurmelMemory class provides a storage mechanism for key-value pairs.
  • Field Details

  • Constructor Details

    • MurmelMemory

      public MurmelMemory()
  • Method Details

    • set

      public void set(String key, Object value)
      Stores a key-value pair in the data map.
      Parameters:
      key - the key with which the specified value is to be associated
      value - the value to be associated with the specified key
    • get

      public Object get(String key)
      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

      public <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.
      Parameters:
      key - the key whose associated value is to be returned
      type - 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

      public <T> T get(String key, Class<T> type)
      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 returned
      type - 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

      public Boolean getBoolean(String key)
      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

      public Byte getByte(String key)
      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

      public Short getShort(String key)
      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

      public Integer getInteger(String key)
      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

      public Long getLong(String key)
      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

      public Float getFloat(String key)
      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

      public Double getDouble(String key)
      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

      public Character getCharacter(String key)
      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

      public String getString(String key)
      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

      public List<?> getList(String key)
      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

      public List<Boolean> getBooleanList(String key)
      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

      public List<Byte> getByteList(String key)
      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

      public List<Short> getShortList(String key)
      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

      public List<Integer> getIntegerList(String key)
      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

      public List<Long> getLongList(String key)
      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

      public List<Float> getFloatList(String key)
      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

      public List<Double> getDoubleList(String key)
      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

      public List<Character> getCharacterList(String key)
      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

      public List<String> getStringList(String key)
      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