ClassConstructor

izumi.distage.constructors.ClassConstructor
See theClassConstructor companion object
final class ClassConstructor[T](val provider: Functoid[T]) extends AnyVal with AnyConstructorBase[T]

An implicitly summonable constructor for a concrete class T

Attributes

Returns:

izumi.distage.model.providers.Functoid[T] value

Example:
import distage.{ClassConstructor, Functoid, Injector, ModuleDef}
class A(val i: Int)
val constructor: Functoid[A] = ClassConstructor[A]
val lifecycle = Injector().produceGet[A](new ModuleDef {
  make[A].from(constructor)
  make[Int].fromValue(5)
})
lifecycle.use {
  (a: A) =>
    println(a.i)
}
Companion:
object
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Concise view

Value members

Concrete fields