In Memory Setting
class provides an in memory version of the settings, mostly useful during unit tests.
Functions
In case you need to stop removing expired keys
Get the typed value stored at key if present, or return null if not. Throws IllegalArgumentException if T is not one of Int
, Long
, String
, Float
, Double
, or Boolean
.
Equivalent to Settings.getBoolean
Equivalent to Settings.getDouble
Equivalent to Settings.getFloat
Equivalent to Settings.getInt
Equivalent to Settings.getLong
Equivalent to Settings.getString
Returns the Boolean
value stored at key, or defaultValue if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow Boolean
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow Boolean
value stored at key, or defaultValue if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns the Boolean
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow Double
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow Double
value stored at key, or defaultValue if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns the Double
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow Float
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow Float
value stored at key, or defaultValue if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns the Float
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow Int
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow Int
value stored at key, or defaultValue if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns the Int
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow Long
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow Long
value stored at key, or defaultValue if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns the Long
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow String
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns a Flow String
value stored at key, or defaultValue if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Returns the String
value stored at key, or null
if no value was stored. If a value of a different type was stored at key
, the behavior is not defined.
Equivalent to Settings.remove
Will loop all keys and remove the expired ones
Stores a typed value at key, or remove what's there if value is null. Throws IllegalArgumentException if T is not one of Int
, Long
, String
, Float
, Double
, or Boolean
.
Equivalent to Settings.putBoolean
Equivalent to Settings.putDouble
Equivalent to Settings.putFloat
Equivalent to Settings.putInt
Equivalent to Settings.putLong
Equivalent to Settings.remove
Equivalent to Settings.putString