Class SuppliedBean<B>

java.lang.Object
io.avaje.inject.spi.SuppliedBean<B>

public abstract class SuppliedBean<B> extends Object
Holds beans supplied to the dependency injection.

These can be externally supplied dependencies or test doubles for testing purposes.

  • Method Details

    • of

      public static SuppliedBean of(Class<?> type, Object bean)
      Create with a class type and bean instance.
    • of

      public static <B> SuppliedBean<B> of(String name, Class<B> type, B bean, Consumer<B> consumer)
      Create for a class type with a consumer that runs once when the bean is obtained.
    • of

      public static <B> SuppliedBean<B> of(String name, Class<B> type, B bean)
      Create for a class type with name.
    • ofType

      public static <B> SuppliedBean<B> ofType(String name, Type type, B bean)
      Create a supplied bean for a generic type.
    • type

      public Type type()
      Return the dependency injection target type.
    • name

      public String name()
      Return the qualifier name of the supplied bean.
    • bean

      public abstract B bean()
      Return the bean instance to use for injection.
    • interfaces

      public abstract Class<?>[] interfaces()
      Return the interfaces to additionally register along with the type.