@FunctionalInterface interface Supplier<R : Any!>
Represents base interface for all functions and function-like objects that return a value and have no arguments. Most of the time this interface is used to pass behaviour to some other code, in many cases enclosing in itself the surrounding state and deferring the computation (creating a clojure).
If you are looking for a supplier interface that can also throw an Exception
please use CheckedSupplier
instead.
See Also
CheckedSupplier
abstract fun get(): R
Returns the |
|
open static fun <R : Any!> memoize(supplier: Supplier<R>): Supplier<R>!
Returns a memoized version of the given |
|
open fun memoized(): Supplier<R>!
Returns memoizing version of this supplier, which computes the return value only once. On subsequent calls the memoized value is returned. |