@Internal
public final class AOTContextUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
containsBean(java.lang.Class<T> beanType,
io.micronaut.context.Qualifier<T> qualifier,
io.micronaut.aot.core.AOTContext aotContext)
Return whether the bean of the given type is contained within this context.
|
static <T> T |
getBean(java.lang.Class<T> beanType,
io.micronaut.aot.core.AOTContext aotContext)
Obtains a Bean for the given type.
|
static <T> T |
getBean(java.lang.Class<T> beanType,
io.micronaut.context.Qualifier<T> qualifier,
io.micronaut.aot.core.AOTContext aotContext)
Obtains a Bean for the given type and qualifier.
|
static <T> java.util.Collection<T> |
getBeansOfType(java.lang.Class<T> beanType,
io.micronaut.aot.core.AOTContext aotContext)
Get all beans of the given type.
|
@NonNull public static <T> java.util.Collection<T> getBeansOfType(@NonNull java.lang.Class<T> beanType, @NonNull io.micronaut.aot.core.AOTContext aotContext)
T
- The bean type parameterbeanType
- The bean typeaotContext
- The AOT Context@NonNull public static <T> T getBean(@NonNull java.lang.Class<T> beanType, @NonNull io.micronaut.aot.core.AOTContext aotContext)
T
- The bean type parameterbeanType
- The bean typeaotContext
- The AOT Contextio.micronaut.context.exceptions.NonUniqueBeanException
- When multiple possible bean definitions exist
for the given typeio.micronaut.context.exceptions.NoSuchBeanException
- If the bean doesn't exist@NonNull public static <T> boolean containsBean(@NonNull java.lang.Class<T> beanType, @Nullable io.micronaut.context.Qualifier<T> qualifier, @NonNull io.micronaut.aot.core.AOTContext aotContext)
T
- The concrete typebeanType
- The bean typequalifier
- The qualifier for the beanaotContext
- The AOT Context@NonNull public static <T> T getBean(@NonNull java.lang.Class<T> beanType, @Nullable io.micronaut.context.Qualifier<T> qualifier, @NonNull io.micronaut.aot.core.AOTContext aotContext)
T
- The bean type parameterbeanType
- The bean typequalifier
- The qualifieraotContext
- The AOT Contextio.micronaut.context.exceptions.NonUniqueBeanException
- When multiple possible bean definitions exist
for the given typeQualifiers