DefaultBoomerangStore

Default implementation of the BoomerangStore interface. Uses a private mutable map to store key-value pairs.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun dropValue(key: String)

Removes a value for the given key.

Link copied to clipboard
open override fun getValue(key: String): Boomerang?

Retrieves a Boomerang value for the given key.

Link copied to clipboard
open override fun packState(): Boomerang

Packs the store into a Boomerang object. Typically used to store current state during configuration changes in order to restore it later.

Link copied to clipboard
open override fun restoreState(boomerang: Boomerang)

Restores the state of the store from a Boomerang object. Typically used to restore state after configuration changes.

Link copied to clipboard
open override fun storeEvent(key: String)

Stores an event notification with the given key. Creates a Boomerang object with a single string entry using the EVENT_KEY constant and the provided key, then stores it in the store.

Link copied to clipboard
open override fun storeValue(key: String, value: Boomerang)

Stores a Boomerang value with the given key.

Link copied to clipboard
fun BoomerangStore.storeValue(key: String, bundle: Bundle)

Stores an Android Bundle in a BoomerangStore with the given key.

inline fun BoomerangStore.storeValue(key: String, resultBuilder: Boomerang.() -> Unit)

Extension function for BoomerangStore that allows storing a value using a builder function. This is a convenient way to create and store a Boomerang in a single expression.

Link copied to clipboard
open fun tryConsumeValue(key: String, catcher: BoomerangCatcher)

Tries to consume a value using a BoomerangCatcher. Default implementation drops the value if it's caught (catcher returns true).