Package io.micronaut.context
Record Class DisabledBean<T>
java.lang.Object
java.lang.Record
io.micronaut.context.DisabledBean<T>
- Type Parameters:
T
- The bean type- Record Components:
type
- The bean typequalifier
- The qualifierreasons
- The reasons the bean is disabled
- All Implemented Interfaces:
AnnotationMetadata
,AnnotationMetadataDelegate
,AnnotationMetadataProvider
,AnnotationSource
,BeanInfo<T>
,Named
,Ordered
,ArgumentCoercible<T>
,BeanContextConditional
,BeanDefinition<T>
,BeanDefinitionReference<T>
,BeanType<T>
,QualifiedBeanType<T>
public record DisabledBean<T>(@NonNull Argument<T> type, @Nullable Qualifier<T> qualifier, @NonNull List<String> reasons)
extends Record
implements BeanDefinition<T>, BeanDefinitionReference<T>
Data about a disabled bean. Used to improve error reporting.
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the bean type.Resolve the declared qualifier for this bean.int
hashCode()
Returns a hash code value for this object.boolean
boolean
isEnabled
(BeanContext context, BeanResolutionContext resolutionContext) Return whether this component is enabled for the given context.boolean
boolean
load()
Loads the bean definition.Returns the value of thequalifier
record component.reasons()
Returns the value of thereasons
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresent
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
getAnnotationMetadata
Methods inherited from interface io.micronaut.inject.BeanContextConditional
isEnabled
Methods inherited from interface io.micronaut.inject.BeanDefinition
findMethod, findPossibleMethods, getConstructor, getContainerElement, getDeclaringType, getExecutableMethods, getInjectedFields, getInjectedMethods, getName, getPostConstructMethods, getPreDestroyMethods, getRequiredComponents, getRequiredMethod, getScope, getScopeName, getTypeArguments, getTypeArguments, getTypeArguments, getTypeParameters, getTypeParameters, hasAnnotatedMethod, isAbstract, isCandidateBean, isIterable, isProxy, resolveDynamicQualifier
Methods inherited from interface io.micronaut.inject.BeanDefinitionReference
isContextScope, isProxiedBean, isProxyTarget, load
Methods inherited from interface io.micronaut.inject.BeanType
getBeanName, getExposedTypes, isContainerType, isPrimary, requiresMethodProcessing
-
Constructor Details
-
Method Details
-
isEnabled
Description copied from interface:BeanContextConditional
Return whether this component is enabled for the given context.- Specified by:
isEnabled
in interfaceBeanContextConditional
- Parameters:
context
- The contextresolutionContext
- The bean resolution context- Returns:
- True if it is
-
isConfigurationProperties
public boolean isConfigurationProperties()- Specified by:
isConfigurationProperties
in interfaceBeanDefinition<T>
- Specified by:
isConfigurationProperties
in interfaceBeanDefinitionReference<T>
- Returns:
- Is the type configuration properties.
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceBeanDefinition<T>
- Specified by:
isSingleton
in interfaceBeanDefinitionReference<T>
- Returns:
- Whether the scope is singleton
-
getDeclaredQualifier
Description copied from interface:BeanDefinition
Resolve the declared qualifier for this bean.- Specified by:
getDeclaredQualifier
in interfaceBeanDefinition<T>
- Specified by:
getDeclaredQualifier
in interfaceQualifiedBeanType<T>
- Returns:
- The qualifier or null if this isn't one
-
getBeanType
Description copied from interface:BeanType
Returns the bean type.- Specified by:
getBeanType
in interfaceBeanDefinition<T>
- Specified by:
getBeanType
in interfaceBeanInfo<T>
- Specified by:
getBeanType
in interfaceBeanType<T>
- Returns:
- The produced bean type
-
asArgument
- Specified by:
asArgument
in interfaceArgumentCoercible<T>
- Specified by:
asArgument
in interfaceBeanDefinition<T>
- Specified by:
asArgument
in interfaceBeanInfo<T>
- Returns:
- The argument
-
getGenericBeanType
- Specified by:
getGenericBeanType
in interfaceBeanDefinition<T>
- Specified by:
getGenericBeanType
in interfaceBeanInfo<T>
- Returns:
- The generic bean type
-
getBeanDefinitionName
- Specified by:
getBeanDefinitionName
in interfaceBeanDefinitionReference<T>
- Returns:
- The class name of the backing
BeanDefinition
-
load
Description copied from interface:BeanDefinitionReference
Loads the bean definition.- Specified by:
load
in interfaceBeanDefinitionReference<T>
- Returns:
- The loaded component definition or null if it shouldn't be loaded
-
isPresent
public boolean isPresent()- Specified by:
isPresent
in interfaceBeanDefinitionReference<T>
- Returns:
- Is the underlying bean type present on the classpath
-
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
qualifier
Returns the value of thequalifier
record component.- Returns:
- the value of the
qualifier
record component
-
reasons
Returns the value of thereasons
record component.- Returns:
- the value of the
reasons
record component
-