Record Class MethodDefinition<K,M>

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

public record MethodDefinition<K,M>(M methodElement, AnnotationMetadata annotationMetadata, List<BeanDefinitionInjectionPoint<K>> injectionPoints, boolean requiresReflection, boolean isOptional, boolean isSetter, @Nullable BeanDefinitionInjectionPoint.PropertyInjectionPoint<K> booleanInjectionPoint) extends Record implements MemberDefinition<K>
Describes a method-related contribution to a bean definition.
Since:
5.1.0
Author:
Denis Stepanov
  • Constructor Details

    • MethodDefinition

      public MethodDefinition(M methodElement, AnnotationMetadata annotationMetadata, List<BeanDefinitionInjectionPoint<K>> injectionPoints, boolean requiresReflection, boolean isOptional, boolean isSetter, @Nullable BeanDefinitionInjectionPoint.PropertyInjectionPoint<K> booleanInjectionPoint)
      Creates an instance of a MethodDefinition record class.
      Parameters:
      methodElement - the value for the methodElement 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
      isOptional - the value for the isOptional record component
      isSetter - the value for the isSetter record component
      booleanInjectionPoint - the value for the booleanInjectionPoint record component
    • MethodDefinition

      public MethodDefinition(M methodElement, AnnotationMetadata annotationMetadata, List<BeanDefinitionInjectionPoint<K>> injectionPoints, boolean requiresReflection)
      Creates a method definition.
      Parameters:
      methodElement - The method element
      annotationMetadata - The annotation metadata
      injectionPoints - The injection points
      requiresReflection - Whether reflective invocation is required
  • 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.
    • methodElement

      public M methodElement()
      Returns the value of the methodElement record component.
      Returns:
      the value of the methodElement 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
    • isOptional

      public boolean isOptional()
      Returns the value of the isOptional record component.
      Returns:
      the value of the isOptional record component
    • isSetter

      public boolean isSetter()
      Returns the value of the isSetter record component.
      Returns:
      the value of the isSetter record component
    • booleanInjectionPoint

      public @Nullable BeanDefinitionInjectionPoint.PropertyInjectionPoint<K> booleanInjectionPoint()
      Returns the value of the booleanInjectionPoint record component.
      Returns:
      the value of the booleanInjectionPoint 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