@Singleton public final class Beans extends Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
get(Class<T> type)
Returns the appropriate instance for the given injection type.
|
static <T> T |
get(Class<T> type,
Annotation qualifier)
Returns the appropriate instance for the given injection type qualified by the given
annotation.
|
static <T> T |
inject(T bean)
Injects dependencies into the fields and methods of
bean . |
public static <T> T get(Class<T> type)
T
- type of the requested beantype
- the requested typepublic static <T> T get(Class<T> type, Annotation qualifier)
T
- type of the requested beantype
- the requested typequalifier
- the qualifier annotationpublic static <T> T inject(T bean)
bean
.T
- type of the beanbean
- to inject members on