Package io.micronaut.context
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>(@NonNull 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(@NonNull Class<T> beanType, @Nullable Class<T> beanTypeToReplace, @Nullable Qualifier<T> qualifier, @Nullable Class<?> factoryClass) Creates an instance of aDefaultReplacesDefinitionrecord class.DefaultReplacesDefinition(@NonNull Class<T> beanType, AnnotationValue<Replaces> replacesAnnotation) -
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.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(@NonNull @NonNull Class<T> beanType, @Nullable @Nullable Class<T> beanTypeToReplace, @Nullable @Nullable Qualifier<T> qualifier, @Nullable @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
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code 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). -
beanType
Returns the value of thebeanTyperecord component.- Returns:
- the value of the
beanTyperecord component
-
beanTypeToReplace
Returns the value of thebeanTypeToReplacerecord component.- Returns:
- the value of the
beanTypeToReplacerecord component
-
qualifier
Returns the value of thequalifierrecord component.- Returns:
- the value of the
qualifierrecord component
-
factoryClass
Returns the value of thefactoryClassrecord component.- Returns:
- the value of the
factoryClassrecord component
-