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 Details

  • Method Details

    • replaces

      public boolean replaces(BeanDefinition<T> beanDefinition)
      Description copied from interface: ReplacesDefinition
      Checks if the given bean definition is replaced by the current bean definition.
      Specified by:
      replaces in interface ReplacesDefinition<T>
      Parameters:
      beanDefinition - The candidate bean definition to be replaced
      Returns:
      true if replaces
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • beanType

      @NonNull public @NonNull Class<T> beanType()
      Returns the value of the beanType record component.
      Returns:
      the value of the beanType record component
    • beanTypeToReplace

      @Nullable public @Nullable Class<T> beanTypeToReplace()
      Returns the value of the beanTypeToReplace record component.
      Returns:
      the value of the beanTypeToReplace record component
    • qualifier

      @Nullable public @Nullable Qualifier<T> qualifier()
      Returns the value of the qualifier record component.
      Returns:
      the value of the qualifier record component
    • factoryClass

      @Nullable public @Nullable Class<?> factoryClass()
      Returns the value of the factoryClass record component.
      Returns:
      the value of the factoryClass record component