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>, AnnotationMetadataProvider, AnnotationSource

public record FieldDefinition<K,F>(F fieldElement, 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
Author:
Denis Stepanov
  • Constructor Details

    • FieldDefinition

      public FieldDefinition(F fieldElement, 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 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 AnnotationMetadata getAnnotationMetadata()
      Returns the annotation metadata associated with this element.
      Specified by:
      getAnnotationMetadata in interface AnnotationMetadataProvider
      Returns:
      The annotation metadata associated with this element