Package io.avaje.inject.spi
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 Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Bbean()Return the bean instance to use for injection.abstract Class<?>[]interfaces()Return the interfaces to additionally register along with the type.Stringname()Return the qualifier name of the supplied bean.static SuppliedBeanof(Class<?> type, Object bean)Create with a class type and bean instance.static <B> SuppliedBean<B>of(String name, Class<B> type, B bean)Create for a class type with name.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.static <B> SuppliedBean<B>ofType(String name, Type type, B bean)Create a supplied bean for a generic type.Typetype()Return the dependency injection target type.
-
-
-
Method Detail
-
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.
-
interfaces
public abstract Class<?>[] interfaces()
Return the interfaces to additionally register along with the type.
-
-