Record Class DefaultReplacesDefinition<T>
java.lang.Object
java.lang.Record
io.micronaut.context.DefaultReplacesDefinition<T>
- Type Parameters:
T- The type of the bean being replaced.- Record Components:
beanType- The type of current bean definition.beanTypeToReplace- The type of the bean being replaced.qualifier- The qualifier of the bean being replaced.factoryClass- The factory class of the bean being replaced.
- All Implemented Interfaces:
ReplacesDefinition<T>
@Internal
public record DefaultReplacesDefinition<T>(Class<T> beanType, @Nullable Class<T> beanTypeToReplace, @Nullable Qualifier<T> qualifier, @Nullable Class<?> factoryClass)
extends Record
implements ReplacesDefinition<T>
Represents the default implementation of the
ReplacesDefinition interface, designed to define rules for replacing
existing bean definitions within a bean context.- Since:
- 5.0
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultReplacesDefinition(Class<T> beanType, AnnotationValue<Replaces> replacesAnnotation) DefaultReplacesDefinition(Class<T> beanType, @Nullable Class<T> beanTypeToReplace, @Nullable Qualifier<T> qualifier, @Nullable Class<?> factoryClass) Creates an instance of aDefaultReplacesDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbeanType()Returns the value of thebeanTyperecord component.Returns the value of thebeanTypeToReplacerecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable Class<?> Returns the value of thefactoryClassrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thequalifierrecord component.booleanreplaces(BeanDefinition<T> beanDefinition) Checks if the given bean definition is replaced by the current bean definition.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DefaultReplacesDefinition
-
DefaultReplacesDefinition
public DefaultReplacesDefinition(Class<T> beanType, @Nullable Class<T> beanTypeToReplace, @Nullable Qualifier<T> qualifier, @Nullable Class<?> factoryClass) Creates an instance of aDefaultReplacesDefinitionrecord class.- Parameters:
beanType- the value for thebeanTyperecord componentbeanTypeToReplace- the value for thebeanTypeToReplacerecord componentqualifier- the value for thequalifierrecord componentfactoryClass- the value for thefactoryClassrecord component
-
-
Method Details
-
replaces
Description copied from interface:ReplacesDefinitionChecks if the given bean definition is replaced by the current bean definition.- Specified by:
replacesin interfaceReplacesDefinition<T>- Parameters:
beanDefinition- The candidate bean definition to be replaced- Returns:
- true if replaces
-
toString
-
hashCode
-
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). -
beanType
-
beanTypeToReplace
Returns the value of thebeanTypeToReplacerecord component.- Returns:
- the value of the
beanTypeToReplacerecord component
-
qualifier
-
factoryClass
Returns the value of thefactoryClassrecord component.- Returns:
- the value of the
factoryClassrecord component
-