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>, io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource

public record ConstructorDefinition<K,C>(C constructorElement, io.micronaut.core.annotation.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
  • Field Summary

    Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

    EMPTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConstructorDefinition(C constructorElement, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, List<BeanDefinitionInjectionPoint<K>> injectionPoints, boolean requiresReflection)
    Creates an instance of a ConstructorDefinition record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.core.annotation.AnnotationMetadata
    Returns the value of the annotationMetadata record component.
    Returns the value of the constructorElement record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    default io.micronaut.core.annotation.AnnotationMetadata
    Returns the annotation metadata associated with this element.
    final int
    Returns a hash code value for this object.
    Returns the value of the injectionPoints record component.
    boolean
    Returns the value of the requiresReflection record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider

    findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType

    Methods inherited from interface io.micronaut.core.annotation.AnnotationSource

    getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
  • Constructor Details

    • ConstructorDefinition

      public ConstructorDefinition(C constructorElement, io.micronaut.core.annotation.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 io.micronaut.core.annotation.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 io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
      Returns the annotation metadata associated with this element.
      Specified by:
      getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProvider
      Returns:
      The annotation metadata associated with this element