SetOnce

open class SetOnce<T>

Represents a value that can be set once, but can be fetched at any time in the application lifecycle.

Author

Noel ([email protected])

Since

24.08.22

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun equals(that: Any): Boolean
Link copied to clipboard
@NotNull
open fun getValue(): T
Returns the value if it was set using the setValue function.
Link copied to clipboard
@Nullable
open fun getValueOrNull(): T
Returns the value if it was ever set using setValue, or null if not.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun reset()
Resets the given value, if needed.
Link copied to clipboard
open fun setValue(@NotNull value: T)
Sets a reference into this setter.
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
open fun wasSet(): Boolean
Was the value set?