InstanceFactory

A Factory implementation that returns a single instance for all invocations of invoke.

Note that while this is a Factory implementation, and thus unscoped, each call to invoke will always return the same instance. As such, any scoping applied to this factory is redundant and unnecessary. However, using this with DoubleCheck.provider is valid and may be desired for testing or contractual guarantees.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val value: T

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
inline fun <T, R> Provider<T>.flatMap(crossinline transform: (T) -> Provider<R>): Provider<R>

Lazily maps this Provider's value to another Provider of type R.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open operator override fun invoke(): T
Link copied to clipboard
open override fun isInitialized(): Boolean
Link copied to clipboard
inline fun <T, R> Provider<T>.map(crossinline transform: (T) -> R): Provider<R>

Lazily maps this Provider's value to another Provider of type R.

Link copied to clipboard

Returns a memoizing Provider instance of this provider.

Link copied to clipboard

Returns a memoizing Lazy instance of this provider.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
inline fun <T, R, V> Provider<T>.zip(other: Provider<R>, crossinline transform: (T, R) -> V): Provider<V>

Lazily zips this Provider's value with another Provider of type R and returns a Provider of type V.