SubTypes

class SubTypes<C : Any, A, T : Any>(contextType: TypeToken<in C>, argType: TypeToken<in A>, createdType: TypeToken<out T>, block: (TypeToken<out T>) -> DIBinding<in C, in A, out T>) : DIBinding<C, A, T>

Binding that holds multiple bindings for subtypes of T.

Parameters

C

The context type of all bindings in the set.

A

The argument type of all bindings in the set.

T

The provided type of all bindings in the set.

block

A function that provides a binding for each subtype.

Constructors

SubTypes
Link copied to clipboard
fun <C : Any, A, T : Any> SubTypes(contextType: TypeToken<in C>, argType: TypeToken<in A>, createdType: TypeToken<out T>, block: (TypeToken<out T>) -> DIBinding<in C, in A, out T>)
The context type of all bindings in the set.

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
factoryFullName
Link copied to clipboard
open fun factoryFullName(): String
The full(er) name of this factory, used for debug print only.
factoryName
Link copied to clipboard
open override fun factoryName(): String
The name of this factory, used for debug print only.
getFactory
Link copied to clipboard
open override fun getFactory(key: DI.Key<C, A, T>, di: BindingDI<C>): (A) -> T
Returns a factory for the given key.
hashCode
Link copied to clipboard
open fun hashCode(): Int
toString
Link copied to clipboard
open fun toString(): String

Properties

argType
Link copied to clipboard
open override val argType: TypeToken<in A>
The type of the argument this factory will function for.
block
Link copied to clipboard
val block: (TypeToken<out T>) -> DIBinding<in C, in A, out T>
A function that provides a binding for each subtype.
contextType
Link copied to clipboard
open override val contextType: TypeToken<in C>
The type of contexts that are to be set when using this factory.
copier
Link copied to clipboard
open val copier: DIBinding.Copier<C, A, T>?
A copier that is responsible for copying / resetting the binding.
createdType
Link copied to clipboard
open override val createdType: TypeToken<out T>
The type of object that is created by this factory.
description
Link copied to clipboard
open val description: String
The description of this factory (using simple type names), used for debug print only.
fullDescription
Link copied to clipboard
open val fullDescription: String
The description of this factory (using full type names), used for debug print only.
scope
Link copied to clipboard
open val scope: Scope<C>?
The scope used by this factory, if any
supportSubTypes
Link copied to clipboard
open override val supportSubTypes: Boolean
Whether this bindings supports subtype handling.