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.The component for which the condition is being evaluated.default boolean
Methods 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, streamOfType
Methods inherited from interface io.micronaut.core.value.PropertyResolver
containsProperties, containsProperty, get, getProperties, getProperties, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyEntries, getPropertyEntries, getPropertyPathMatches, getRequiredProperty
Methods 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
BeanDefinition
or aBeanConfiguration
-
getBeanContext
BeanContext getBeanContext()- Returns:
- The bean context
-
getBeanResolutionContext
BeanResolutionContext getBeanResolutionContext()- Returns:
- The resolution context
-
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
-