Id

izumi.distage.model.definition.Id
final class Id(val name: String) extends DIStageAnnotation

Annotation for summoning named instances.

Example:

 val module = new ModuleDef {
   make[Int].named("three").from(3)
   make[Int].named("five").from(5)
 }

 Injector().produce(module).run {
   (five: Int @Id("five"), three: Int @Id("three")) =>
     assert(5 == five)
     assert(3 == three)
 }

Attributes

Note

javax.inject.Named annotation is also supported

Graph
Supertypes
trait TypeConstraint
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete fields

val name: String