Class 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 Detail

      • 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.
      • 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.