sdk-common / com.tomtom.online.sdk.common.functional / Supplier

Supplier

@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

Functions

get

abstract fun get(): R

Returns the Supplier result.

memoize

open static fun <R : Any!> memoize(supplier: Supplier<R>): Supplier<R>!

Returns a memoized version of the given Supplier. For more information please refer to #memoized().

memoized

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.