sealed trait AnyConstructor[T] extends AnyConstructorOptionalMakeDSL[T]
An implicitly summonable constructor for a type T
, can generate constructors for:
- concrete classes (using ClassConstructor)
- traits and abstract classes (Auto-Traits feature, using TraitConstructor)
Since version 1.1.0
, does not generate constructors "factory-like" traits and abstract classes, instead use FactoryConstructor.
Use ZEnvConstructor to generate constructors for zio.ZEnvironment
values.
- returns
import distage.{AnyConstructor, Functoid, Injector, ModuleDef} class A(val i: Int) val constructor: Functoid[A] = AnyConstructor[A] val lifecycle = Injector().produceGet[A](new ModuleDef { make[A].from(constructor) make[Int].fromValue(5) }) lifecycle.use { (a: A) => println(a.i) }
Example:
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- AnyConstructor
- AnyConstructorOptionalMakeDSL
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Abstract Value Members
- abstract def getClass(): Class[_ <: AnyRef]
- Definition Classes
- Any
- abstract def provider: Functoid[T]
- Definition Classes
- AnyConstructor → AnyConstructorOptionalMakeDSL
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def equals(arg0: Any): Boolean
- Definition Classes
- Any
- def hashCode(): Int
- Definition Classes
- Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def toString(): String
- Definition Classes
- Any