Cached

interface Cached<T> : Any

Fields

Name Description
abstract isValid: Boolean
abstract isInvalid: Boolean
abstract value: T

Methods

regenerate

abstract fun regenerate()

ReturnValue

Name Description
Unit

regenerating

open fun <R> regenerating(consumer: (T)->R): R

Parameters

Name Description
consumer: (T)->R

ReturnValue

Name Description
R

invalidate

abstract fun invalidate()

ReturnValue

Name Description
Unit

ifValid

open fun <R> ifValid(consumer: (T)->R): Optional<R>

Parameters

Name Description
consumer: (T)->R

ReturnValue

Name Description
Optional<R>

CompanionObject

Cached

interface Cached<T> : Any

Methods

of

fun <T> of(generator: ()->T): Cached<T>

Parameters

Name Description
generator: ()->T

ReturnValue

Name Description
Cached<T>