Record Class ScalaFieldData
java.lang.Object
java.lang.Record
io.micronaut.scala.processing.visitor.ScalaFieldData
- Record Components:
name- The field nametype- The field typeannotations- The annotationsmodifiers- The modifiersenumConstant- Whether this field is an enum constantconstantValue- The compile-time constant value, if anynativeType- The native Scala compiler objectgenericType- The type with the declaring type's variables bound, ornullwhen 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 Summary
ConstructorsConstructorDescriptionScalaFieldData(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.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 aScalaFieldDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theannotationsrecord component.@Nullable ObjectReturns the value of theconstantValuerecord component.booleanReturns the value of theenumConstantrecord component.booleanA declaration is itself: two are equal only when they are the same object.@Nullable ScalaTypeDataReturns the value of thegenericTyperecord component.inthashCode()Returns a hash code value for this object.Set<io.micronaut.inject.ast.ElementModifier> Returns the value of themodifiersrecord component.name()Returns the value of thenamerecord component.Returns the value of thenativeTyperecord component.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.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
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 nametype- The typeannotations- The annotationsmodifiers- The modifiersenumConstant- Whether this is an enum constantconstantValue- The constant value, if anynativeType- 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 aScalaFieldDatarecord class.- Parameters:
name- the value for thenamerecord componenttype- the value for thetyperecord componentannotations- the value for theannotationsrecord componentmodifiers- the value for themodifiersrecord componentenumConstant- the value for theenumConstantrecord componentconstantValue- the value for theconstantValuerecord componentnativeType- the value for thenativeTyperecord componentgenericType- the value for thegenericTyperecord component
-
-
Method Details
-
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
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. -
hashCode
-
toString
-
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceScalaAnnotatedElementData- Returns:
- the value of the
namerecord component
-
type
-
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfaceScalaAnnotatedElementData- Returns:
- the value of the
annotationsrecord component
-
modifiers
-
enumConstant
public boolean enumConstant()Returns the value of theenumConstantrecord component.- Returns:
- the value of the
enumConstantrecord component
-
constantValue
Returns the value of theconstantValuerecord component.- Returns:
- the value of the
constantValuerecord component
-
nativeType
Returns the value of thenativeTyperecord component.- Specified by:
nativeTypein interfaceScalaAnnotatedElementData- Returns:
- the value of the
nativeTyperecord component
-
genericType
Returns the value of thegenericTyperecord component.- Returns:
- the value of the
genericTyperecord component
-