Class SuppliedBean


  • public class SuppliedBean
    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 of​(String name,
                                          Class<B> type,
                                          Consumer<B> consumer)
        Create for a class type with a consumer that runs once when the bean is obtained.
      • secondary

        public static SuppliedBean secondary​(String name,
                                             Type type,
                                             Object source)
        Create a supplied bean with SECONDARY priority as a default fallback dependency that is only used when no other matching one is provided.
      • source

        public Object source()
        Return the bean instance or provider to use for injection.
      • priority

        public final int priority()
        Return the associated priority.
      • type

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

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

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