Named

value class Named(di: DIAware)

Functions

Factory
Link copied to clipboard
common
fun <A, T : Any> Factory(argType: TypeToken<in A>, type: TypeToken<out T>): DIProperty<(A) -> T>

Gets a factory of T for the given argument type and return type. The name of the receiving property is used as tag.

FactoryOrNull
Link copied to clipboard
common
fun <A, T : Any> FactoryOrNull(argType: TypeToken<in A>, type: TypeToken<out T>): DIProperty<(A) -> T?>

Gets a factory of T for the given argument type and return type, or null if none is found. The name of the receiving property is used as tag.

Instance
Link copied to clipboard
common
fun <T : Any> Instance(type: TypeToken<out T>): DIProperty<T>

Gets an instance of T for the given type. The name of the receiving property is used as tag.

fun <A, T : Any> Instance(argType: TypeToken<in A>, type: TypeToken<T>, arg: () -> A): DIProperty<T>

Gets an instance of T for the given type, curried from a factory that takes an argument A. The name of the receiving property is used as tag.

InstanceOrNull
Link copied to clipboard
common
fun <T : Any> InstanceOrNull(type: TypeToken<out T>): DIProperty<T?>

Gets an instance of T for the given type, or null if none is found. The name of the receiving property is used as tag.

fun <A, T : Any> InstanceOrNull(argType: TypeToken<in A>, type: TypeToken<out T>, arg: () -> A): DIProperty<T?>

Gets an instance of T for the given type, curried from a factory that takes an argument A, or null if none is found. The name of the receiving property is used as tag.

Provider
Link copied to clipboard
common
fun <T : Any> Provider(type: TypeToken<out T>): DIProperty<() -> T>

Gets a provider of T for the given type. The name of the receiving property is used as tag.

fun <A, T : Any> Provider(argType: TypeToken<in A>, type: TypeToken<out T>, arg: () -> A): DIProperty<() -> T>

Gets a provider of T for the given type, curried from a factory that takes an argument A. The name of the receiving property is used as tag.

ProviderOrNull
Link copied to clipboard
common
fun <T : Any> ProviderOrNull(type: TypeToken<out T>): DIProperty<() -> T?>

Gets a provider of T for the given type, or null if none is found. The name of the receiving property is used as tag.

fun <A, T : Any> ProviderOrNull(argType: TypeToken<in A>, type: TypeToken<out T>, arg: () -> A): DIProperty<() -> T?>

Gets a provider of T for the given type, curried from a factory that takes an argument A, or null if none is found. The name of the receiving property is used as tag.

Properties

di
Link copied to clipboard
common
val di: DIAware

Extensions

factory
Link copied to clipboard
common
inline fun <A : Any, T : Any> Named.factory(): DIProperty<(A) -> T>

Gets a factory of T for the given argument type and return type. The name of the receiving property is used as tag.

factoryOrNull
Link copied to clipboard
common
inline fun <A : Any, T : Any> Named.factoryOrNull(): DIProperty<(A) -> T?>

Gets a factory of T for the given argument type and return type, or nul if none is found. The name of the receiving property is used as tag.

instance
Link copied to clipboard
common
inline fun <T : Any> Named.instance(): DIProperty<T>

Gets an instance of T for the given type. The name of the receiving property is used as tag.

inline fun <A : Any, T : Any> Named.instance(arg: A): DIProperty<T>
inline fun <A, T : Any> Named.instance(arg: Typed<A>): DIProperty<T>
inline fun <A : Any, T : Any> Named.instance(noinline fArg: () -> A): DIProperty<T>

Gets an instance of T for the given type, curried from a factory that takes an argument A. The name of the receiving property is used as tag.

instanceOrNull
Link copied to clipboard
common
inline fun <T : Any> Named.instanceOrNull(): DIProperty<T?>

Gets an instance of T for the given type, or null if none is found. The name of the receiving property is used as tag.

inline fun <A : Any, T : Any> Named.instanceOrNull(arg: A): DIProperty<T?>
inline fun <A, T : Any> Named.instanceOrNull(arg: Typed<A>): DIProperty<T?>
inline fun <A : Any, T : Any> Named.instanceOrNull(noinline fArg: () -> A): DIProperty<T?>

Gets an instance of T for the given type, curried from a factory that takes an argument A, or null if none is found. The name of the receiving property is used as tag.

provider
Link copied to clipboard
common
inline fun <T : Any> Named.provider(): DIProperty<() -> T>

Gets a provider of T for the given type. The name of the receiving property is used as tag.

inline fun <A : Any, T : Any> Named.provider(arg: A): DIProperty<() -> T>
inline fun <A : Any, T : Any> Named.provider(arg: Typed<A>): DIProperty<() -> T>
inline fun <A : Any, T : Any> Named.provider(noinline fArg: () -> A): DIProperty<() -> T>

Gets a provider of T for the given type, curried from a factory that takes an argument A. The name of the receiving property is used as tag.

providerOrNull
Link copied to clipboard
common
inline fun <T : Any> Named.providerOrNull(): DIProperty<() -> T?>

Gets a provider of T for the given type, or null if none is found. The name of the receiving property is used as tag.

inline fun <A : Any, T : Any> Named.providerOrNull(arg: A): DIProperty<() -> T?>
inline fun <A, T : Any> Named.providerOrNull(arg: Typed<A>): DIProperty<() -> T?>
inline fun <A : Any, T : Any> Named.providerOrNull(noinline fArg: () -> A): DIProperty<() -> T?>

Gets a provider of T for the given type, curried from a factory that takes an argument A, or null if none is found. The name of the receiving property is used as tag.