Record Class ConstructorDefinition<K,C>

java.lang.Object
java.lang.Record
io.micronaut.context.beans.definition.ConstructorDefinition<K,C>
Type Parameters:
K - The bean element kind type
C - The constructor representation type
All Implemented Interfaces:
MemberDefinition<K>, AnnotationMetadataProvider, AnnotationSource

public record ConstructorDefinition<K,C>(C constructorElement, AnnotationMetadata annotationMetadata, List<BeanDefinitionInjectionPoint<K>> injectionPoints, boolean requiresReflection) extends Record implements MemberDefinition<K>
Describes a constructor used in a bean definition.
Since:
5.1.0
Author:
Denis Stepanov
  • Constructor Details

    • ConstructorDefinition

      public ConstructorDefinition(C constructorElement, AnnotationMetadata annotationMetadata, List<BeanDefinitionInjectionPoint<K>> injectionPoints, boolean requiresReflection)
      Creates an instance of a ConstructorDefinition record class.
      Parameters:
      constructorElement - the value for the constructorElement record component
      annotationMetadata - the value for the annotationMetadata record component
      injectionPoints - the value for the injectionPoints record component
      requiresReflection - the value for the requiresReflection record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • constructorElement

      public C constructorElement()
      Returns the value of the constructorElement record component.
      Returns:
      the value of the constructorElement record component
    • annotationMetadata

      public AnnotationMetadata annotationMetadata()
      Returns the value of the annotationMetadata record component.
      Returns:
      the value of the annotationMetadata record component
    • injectionPoints

      public List<BeanDefinitionInjectionPoint<K>> injectionPoints()
      Returns the value of the injectionPoints record component.
      Specified by:
      injectionPoints in interface MemberDefinition<K>
      Returns:
      the value of the injectionPoints record component
    • requiresReflection

      public boolean requiresReflection()
      Returns the value of the requiresReflection record component.
      Returns:
      the value of the requiresReflection record component
    • getAnnotationMetadata

      default AnnotationMetadata getAnnotationMetadata()
      Returns the annotation metadata associated with this element.
      Specified by:
      getAnnotationMetadata in interface AnnotationMetadataProvider
      Returns:
      The annotation metadata associated with this element