Package io.micronaut.context.condition
Interface ConditionContext<T extends AnnotationMetadataProvider>
- Type Parameters:
T- The type
- All Superinterfaces:
BeanLocator,PropertyResolver,ValueResolver<String>
public interface ConditionContext<T extends AnnotationMetadataProvider>
extends BeanLocator, PropertyResolver
The ConditionContext passed to a
Condition.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptionFail the condition with the given message.default ConditionContext<T> Fail the condition with the given message.<K> @NonNull Collection<BeanDefinition<K>> findBeanDefinitions(@NonNull Class<K> beanType) Finds and returns all bean definitions of the specified type.The component for which the condition is being evaluated.default booleanMethods inherited from interface io.micronaut.context.BeanLocator
findBean, findBean, findBean, findBean, findOrInstantiateBean, getBean, getBean, getBean, getBean, getBean, getBeansOfType, getBeansOfType, getBeansOfType, getBeansOfType, getProvider, getProvider, getProvider, getProvider, getProxyTargetBean, getProxyTargetBean, mapOfType, mapOfType, mapOfType, mapOfType, streamOfType, streamOfType, streamOfType, streamOfTypeMethods inherited from interface io.micronaut.core.value.PropertyResolver
containsProperties, containsProperty, get, getProperties, getProperties, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyEntries, getPropertyEntries, getPropertyPathMatches, getRequiredPropertyMethods inherited from interface io.micronaut.core.value.ValueResolver
get, get, get
-
Method Details
-
getComponent
T getComponent()The component for which the condition is being evaluated.- Returns:
- Either a
BeanDefinitionor aBeanConfiguration
-
getBeanContext
BeanContext getBeanContext()- Returns:
- The bean context
-
getBeanResolutionContext
- Returns:
- The resolution context
-
findBeanDefinitions
@NonNull <K> @NonNull Collection<BeanDefinition<K>> findBeanDefinitions(@NonNull @NonNull Class<K> beanType) Finds and returns all bean definitions of the specified type.- Type Parameters:
K- The type of the beans.- Parameters:
beanType- The class type of the beans to find.- Returns:
- A collection of
BeanDefinitioninstances corresponding to the specified type. - Since:
- 5.0
-
fail
Fail the condition with the given message.- Parameters:
failure- The failure- Returns:
- The
ConditionContext
-
fail
Fail the condition with the given message.- Parameters:
failure- The failure- Returns:
- The
ConditionContext
-
getFailures
- Returns:
- A list of failures for the condition
-
isFailing
default boolean isFailing()- Returns:
- Whether there are any failures
-