Record Class FieldDefinition<K,F>

java.lang.Object
java.lang.Record
io.micronaut.context.beans.definition.FieldDefinition<K,F>
Type Parameters:
K - The bean element kind type
F - The field representation type
All Implemented Interfaces:
MemberDefinition<K>, io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource

public record FieldDefinition<K,F>(F fieldElement, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, BeanDefinitionInjectionPoint<K> injectionPoint, boolean requiresReflection, boolean isOptional) extends Record implements MemberDefinition<K>
Describes a field injection 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
    FieldDefinition(F fieldElement, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, BeanDefinitionInjectionPoint<K> injectionPoint, boolean requiresReflection, boolean isOptional)
    Creates an instance of a FieldDefinition record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.core.annotation.AnnotationMetadata
    Returns the value of the annotationMetadata record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the fieldElement record component.
    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 injectionPoint record component.
    Returns the injection points contributed by this member definition.
    boolean
    Returns the value of the isOptional 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

    • FieldDefinition

      public FieldDefinition(F fieldElement, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, BeanDefinitionInjectionPoint<K> injectionPoint, boolean requiresReflection, boolean isOptional)
      Creates an instance of a FieldDefinition record class.
      Parameters:
      fieldElement - the value for the fieldElement record component
      annotationMetadata - the value for the annotationMetadata record component
      injectionPoint - the value for the injectionPoint record component
      requiresReflection - the value for the requiresReflection record component
      isOptional - the value for the isOptional record component
  • Method Details

    • injectionPoints

      public List<BeanDefinitionInjectionPoint<K>> injectionPoints()
      Description copied from interface: MemberDefinition
      Returns the injection points contributed by this member definition.
      Specified by:
      injectionPoints in interface MemberDefinition<K>
      Returns:
      The injection points contributed by this member definition
    • 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.
    • fieldElement

      public F fieldElement()
      Returns the value of the fieldElement record component.
      Returns:
      the value of the fieldElement 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
    • injectionPoint

      public BeanDefinitionInjectionPoint<K> injectionPoint()
      Returns the value of the injectionPoint record component.
      Returns:
      the value of the injectionPoint 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
    • 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