BooleanPool

object BooleanPool : ObjectPool<Boolean>

Boolean Pool

The boolean pool stores commonly used Boolean that must be created throughout the project and take a long time to build.

Example:

BooleanPool["key"] = true

Since

1.4.0

See also

Properties

Link copied to clipboard
var objects: HashMap<String, Boolean>
Link copied to clipboard
val size: Int

Pool size

Functions

Link copied to clipboard
fun first(): Boolean

Returns the first value or throws an exception if pool is empty.

Link copied to clipboard
inline fun firstOrElse(defaultValue: () -> Boolean): Boolean

Returns the first value, or the result of the defaultValue function if there was no entry.

Link copied to clipboard
fun firstOrNull(): Boolean?

Returns the first value, or null if this pool contains no entry.

Link copied to clipboard
operator fun get(key: String): Boolean

Returns the value for the given key or throws an exception if there is no such key in the pool.

Link copied to clipboard
inline fun getOrElse(key: String, defaultValue: () -> Boolean): Boolean

Returns the value for the given key, or the result of the defaultValue function if there was no entry for the given key.

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

Returns the value to which the specified key is mapped, or null if this pool contains no mapping for the key.

Link copied to clipboard
fun last(): Boolean

Returns the last value or throws an exception if pool is empty.

Link copied to clipboard
inline fun lastOrElse(defaultValue: () -> Boolean): Boolean

Returns the last value, or the result of the defaultValue function if there was no entry.

Link copied to clipboard
fun lastOrNull(): Boolean?

Returns the last value, or null if this pool contains no entry.

Link copied to clipboard
operator fun set(key: String, value: Boolean)

Allows to use the index operator for storing values in a pool.