KeyValueStorage class abstract

@ingroup navigine_dart_classes @ingroup navigine_dart_managers @brief Interface for key-value storage operations, allowing storage and retrieval of various data types.

Referenced from @see StorageManager "StorageManager".

Implemented types
Implementers

Constructors

KeyValueStorage()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Removes all entries from the storage.
contains(String key) bool
Checks whether the key exists in the storage. @param key Key to check. @return true if a value is stored under the key (regardless of type).
getBool(String key, bool defaultValue) bool
Gets a boolean value. Returns defaultValue if the key is missing or the stored type is not bool. @param key Lookup key. @param defaultValue Value to return when not found or type mismatch. @return Stored bool or defaultValue.
getDouble(String key, double defaultValue) double
Gets a 64-bit floating-point value. Returns defaultValue if the key is missing or the stored type is not double. @param key Lookup key. @param defaultValue Value to return when not found or type mismatch. @return Stored double or defaultValue.
getFloat(String key, double defaultValue) double
Gets a 32-bit floating-point value. Returns defaultValue if the key is missing or the stored type is not float. @param key Lookup key. @param defaultValue Value to return when not found or type mismatch. @return Stored float or defaultValue.
getInt(String key, int defaultValue) int
Gets a 32-bit integer value. Returns defaultValue if the key is missing or the stored type is not int. @param key Lookup key. @param defaultValue Value to return when not found or type mismatch. @return Stored int32 or defaultValue.
getKeys() List<String>
Returns all keys currently stored. @return List of keys. Order is implementation-defined (not guaranteed).
getLong(String key, int defaultValue) int
Gets a 64-bit integer value. Returns defaultValue if the key is missing or the stored type is not long. @param key Lookup key. @param defaultValue Value to return when not found or type mismatch. @return Stored int64 or defaultValue.
getString(String key, String defaultValue) String
Gets a string value. Returns defaultValue if the key is missing or the stored type is not string. @param key Lookup key. @param defaultValue Value to return when not found or type mismatch. @return Stored string or defaultValue.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putBool(String key, bool value) → void
Stores a boolean value under the key, replacing any existing value. @param key Key to set. @param value Value to store.
putDouble(String key, double value) → void
Stores a 64-bit floating-point value under the key, replacing any existing value. @param key Key to set. @param value Value to store.
putFloat(String key, double value) → void
Stores a 32-bit floating-point value under the key, replacing any existing value. @param key Key to set. @param value Value to store.
putInt(String key, int value) → void
Stores a 32-bit integer value under the key, replacing any existing value. @param key Key to set. @param value Value to store.
putLong(String key, int value) → void
Stores a 64-bit integer value under the key, replacing any existing value. @param key Key to set. @param value Value to store.
putString(String key, String value) → void
Stores a string value under the key, replacing any existing value. @param key Key to set. @param value Value to store.
remove(String key) → void
Removes a value by key. No-op if the key does not exist. @param key Key to remove.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited