Boomerang

interface Boomerang(source)

A key-value store for storing and retrieving data across different parts of your application. This interface is implemented by platform-specific classes to provide a consistent API across all platforms.

Boomerang is designed to be used in multiplatform projects and works on Android, iOS, and Desktop.

Inheritors

Functions

Link copied to clipboard
abstract fun clear()

Removes all values from this Boomerang instance.

Link copied to clipboard
abstract fun contains(key: String): Boolean

Checks if a value exists for the given key.

Link copied to clipboard
abstract fun getBoolean(key: String): Boolean?

Retrieves a Boolean value for the given key.

Link copied to clipboard
abstract fun getBoomerang(key: String): Boomerang?

Retrieves a Boomerang instance for the given key.

Link copied to clipboard
abstract fun getBoomerangsList(key: String): List<Boomerang>?

Retrieves a list of Boomerang instances for the given key.

Link copied to clipboard
fun Boomerang.getBundle(key: String): Bundle?

Retrieves an Android Bundle from the Boomerang with the given key.

Link copied to clipboard
abstract fun getByte(key: String): Byte?

Retrieves a Byte value for the given key.

Link copied to clipboard
abstract fun getByteArray(key: String): ByteArray?

Retrieves a ByteArray value for the given key.

Link copied to clipboard
abstract fun getChar(key: String): Char?

Retrieves a Char value for the given key.

Link copied to clipboard
abstract fun getDouble(key: String): Double?

Retrieves a Double value for the given key.

Link copied to clipboard
abstract fun getFloat(key: String): Float?

Retrieves a Float value for the given key.

Link copied to clipboard
abstract fun getInt(key: String): Int?

Retrieves an Int value for the given key.

Link copied to clipboard

Retrieves a Java Serializable object from the Boomerang with the given key.

Link copied to clipboard
abstract fun getKeys(): Set<String>

Gets all keys in this Boomerang instance.

Link copied to clipboard
abstract fun getLong(key: String): Long?

Retrieves a Long value for the given key.

Link copied to clipboard
inline fun <T : Parcelable> Boomerang.getParcelable(key: String): T?

Retrieves a Parcelable object from the Boomerang with the given key.

Link copied to clipboard
abstract fun getShort(key: String): Short?

Retrieves a Short value for the given key.

Link copied to clipboard
abstract fun getString(key: String): String?

Retrieves a String value for the given key.

Link copied to clipboard
abstract fun putBoolean(key: String, value: Boolean)

Stores a Boolean value with the given key.

Link copied to clipboard
abstract fun putBoomerang(key: String, boomerang: Boomerang)

Stores a Boomerang instance with the given key. This allows for nested data structures.

Link copied to clipboard
abstract fun putBoomerangsList(key: String, boomerangs: List<Boomerang>)

Stores a list of Boomerang instances with the given key. This allows for storing collections of nested data structures.

Link copied to clipboard
fun Boomerang.putBundle(key: String, value: Bundle)

Stores an Android Bundle in the Boomerang with the given key.

Link copied to clipboard
abstract fun putByte(key: String, value: Byte)

Stores a Byte value with the given key.

Link copied to clipboard
abstract fun putByteArray(key: String, value: ByteArray)

Stores a ByteArray value with the given key.

Link copied to clipboard
abstract fun putChar(key: String, value: Char)

Stores a Char value with the given key.

Link copied to clipboard
abstract fun putDouble(key: String, value: Double)

Stores a Double value with the given key.

Link copied to clipboard
abstract fun putFloat(key: String, value: Float)

Stores a Float value with the given key.

Link copied to clipboard
abstract fun putInt(key: String, value: Int)

Stores an Int value with the given key.

Link copied to clipboard

Stores a Java Serializable object in the Boomerang with the given key.

Link copied to clipboard
abstract fun putLong(key: String, value: Long)

Stores a Long value with the given key.

Link copied to clipboard
fun <T : Parcelable> Boomerang.putParcelable(key: String, value: T)

Stores a Parcelable object in the Boomerang with the given key.

Link copied to clipboard
abstract fun putShort(key: String, value: Short)

Stores a Short value with the given key.

Link copied to clipboard
abstract fun putString(key: String, value: String)

Stores a String value with the given key.

Link copied to clipboard
abstract fun remove(key: String)

Removes the value for the given key.

Link copied to clipboard
fun Boomerang.toBundle(): Bundle

Converts a Boomerang to an Android Bundle.