LazyClassKey

data class LazyClassKey<T : Any>(val type: KClass<T>) : LazyKey<T> , ClassKey<T>

A ClassKey that provides a single value that is computed lazily.

It overrides equals and hashCode to be based solely on the service type. This ensures it is considered equal to any other ClassKey (like SingletonClassKey) for the same service type.

Constructors

Link copied to clipboard
constructor(type: KClass<T>)

Properties

Link copied to clipboard
open override val type: KClass<T>

A reference to the type provided by this key.

Functions

Link copied to clipboard
open override fun createEntry(params: LazyKey.PutParams<T>): LazyKey.Entry<T, T>

Creates an Entry to provide values.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun getValue(params: Unit, entry: ServiceEntry<T>): T

Retrieve the value from entry. The entry will have been created by a ServiceKey that is equals to this key. If this ServiceKey is only equals to other keys of the same class, then entry will be guaranteed to be of type Entry.

Link copied to clipboard
open override fun hashCode(): Int