Record Class ScalaFieldData

java.lang.Object
java.lang.Record
io.micronaut.scala.processing.visitor.ScalaFieldData
Record Components:
name - The field name
type - The field type
annotations - The annotations
modifiers - The modifiers
enumConstant - Whether this field is an enum constant
constantValue - The compile-time constant value, if any
nativeType - The native Scala compiler object
genericType - The type with the declaring type's variables bound, or null when it is the declared one
All Implemented Interfaces:
ScalaAnnotatedElementData

public record ScalaFieldData(String name, ScalaTypeData type, List<ScalaAnnotationData> annotations, Set<io.micronaut.inject.ast.ElementModifier> modifiers, boolean enumConstant, @Nullable Object constantValue, Object nativeType, @Nullable ScalaTypeData genericType) extends Record implements ScalaAnnotatedElementData
A Scala field.
  • Constructor Details

    • ScalaFieldData

      public ScalaFieldData(String name, ScalaTypeData type, List<ScalaAnnotationData> annotations, Set<io.micronaut.inject.ast.ElementModifier> modifiers, boolean enumConstant, @Nullable Object constantValue, Object nativeType)
      A field as declared, whose generic type is its declared one.
      Parameters:
      name - The name
      type - The type
      annotations - The annotations
      modifiers - The modifiers
      enumConstant - Whether this is an enum constant
      constantValue - The constant value, if any
      nativeType - The native Scala compiler object
    • ScalaFieldData

      public ScalaFieldData(String name, ScalaTypeData type, List<ScalaAnnotationData> annotations, Set<io.micronaut.inject.ast.ElementModifier> modifiers, boolean enumConstant, @Nullable Object constantValue, Object nativeType, @Nullable ScalaTypeData genericType)
      Creates an instance of a ScalaFieldData record class.
      Parameters:
      name - the value for the name record component
      type - the value for the type record component
      annotations - the value for the annotations record component
      modifiers - the value for the modifiers record component
      enumConstant - the value for the enumConstant record component
      constantValue - the value for the constantValue record component
      nativeType - the value for the nativeType record component
      genericType - the value for the genericType record component
  • Method Details

    • resolvedType

      public ScalaTypeData resolvedType()
      The type with the declaring type's variables bound as they were at the point of use; type() stays the declared one, which is what the field compiles to.
      Returns:
      The generic type
    • equals

      public boolean equals(Object other)
      A declaration is itself: two are equal only when they are the same object. Record equality would compare every member, type and annotation beneath, and core keeps these as keys of a hash map -- so every lookup was hashing the whole model of the class.
      Specified by:
      equals in class Record
    • hashCode

      public 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
    • 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
    • name

      public String name()
      Returns the value of the name record component.
      Specified by:
      name in interface ScalaAnnotatedElementData
      Returns:
      the value of the name record component
    • type

      public ScalaTypeData type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • annotations

      public List<ScalaAnnotationData> annotations()
      Returns the value of the annotations record component.
      Specified by:
      annotations in interface ScalaAnnotatedElementData
      Returns:
      the value of the annotations record component
    • modifiers

      public Set<io.micronaut.inject.ast.ElementModifier> modifiers()
      Returns the value of the modifiers record component.
      Returns:
      the value of the modifiers record component
    • enumConstant

      public boolean enumConstant()
      Returns the value of the enumConstant record component.
      Returns:
      the value of the enumConstant record component
    • constantValue

      public @Nullable Object constantValue()
      Returns the value of the constantValue record component.
      Returns:
      the value of the constantValue record component
    • nativeType

      public Object nativeType()
      Returns the value of the nativeType record component.
      Specified by:
      nativeType in interface ScalaAnnotatedElementData
      Returns:
      the value of the nativeType record component
    • genericType

      public @Nullable ScalaTypeData genericType()
      Returns the value of the genericType record component.
      Returns:
      the value of the genericType record component