Record Class ScalaMethodData

java.lang.Object
java.lang.Record
io.micronaut.scala.processing.visitor.ScalaMethodData
Record Components:
name - The method name
returnType - The return type
parameters - The parameters
typeParameters - The declared generic placeholders
thrownTypes - The declared thrown types
annotations - The annotations
modifiers - The modifiers
constructor - Whether this represents a constructor
nativeType - The native Scala compiler object
overriddenMethods - The declarations this method overrides, least specific first
genericReturnType - The return type with the declaring type's variables bound, or null when it is the declared one
All Implemented Interfaces:
ScalaAnnotatedElementData

public record ScalaMethodData(String name, ScalaTypeData returnType, List<ScalaParameterData> parameters, List<ScalaTypeData> typeParameters, List<ScalaTypeData> thrownTypes, List<ScalaAnnotationData> annotations, Set<io.micronaut.inject.ast.ElementModifier> modifiers, boolean constructor, Object nativeType, List<ScalaMethodData> overriddenMethods, @Nullable ScalaTypeData genericReturnType) extends Record implements ScalaAnnotatedElementData
A Scala method or constructor.
  • Constructor Details

    • ScalaMethodData

      public ScalaMethodData(String name, ScalaTypeData returnType, List<ScalaParameterData> parameters, List<ScalaTypeData> typeParameters, List<ScalaTypeData> thrownTypes, List<ScalaAnnotationData> annotations, Set<io.micronaut.inject.ast.ElementModifier> modifiers, boolean constructor, Object nativeType, List<ScalaMethodData> overriddenMethods)
      A method as declared, whose generic return type is its declared one.
      Parameters:
      name - The method name
      returnType - The return type
      parameters - The parameters
      typeParameters - The type parameters
      thrownTypes - The declared thrown types
      annotations - The annotations
      modifiers - The modifiers
      constructor - Whether this is a constructor
      nativeType - The native Scala compiler object
      overriddenMethods - The declarations this method overrides
    • ScalaMethodData

      public ScalaMethodData(String name, ScalaTypeData returnType, List<ScalaParameterData> parameters, List<ScalaTypeData> typeParameters, List<ScalaTypeData> thrownTypes, List<ScalaAnnotationData> annotations, Set<io.micronaut.inject.ast.ElementModifier> modifiers, boolean constructor, Object nativeType)
      A method without the declarations it overrides, for the overridden ones themselves.
      Parameters:
      name - The method name
      returnType - The return type
      parameters - The parameters
      typeParameters - The type parameters
      thrownTypes - The declared thrown types
      annotations - The annotations
      modifiers - The modifiers
      constructor - Whether this is a constructor
      nativeType - The native Scala compiler object
    • ScalaMethodData

      public ScalaMethodData(String name, ScalaTypeData returnType, List<ScalaParameterData> parameters, List<ScalaTypeData> typeParameters, List<ScalaTypeData> thrownTypes, List<ScalaAnnotationData> annotations, Set<io.micronaut.inject.ast.ElementModifier> modifiers, boolean constructor, Object nativeType, List<ScalaMethodData> overriddenMethods, @Nullable ScalaTypeData genericReturnType)
      Creates an instance of a ScalaMethodData record class.
      Parameters:
      name - the value for the name record component
      returnType - the value for the returnType record component
      parameters - the value for the parameters record component
      typeParameters - the value for the typeParameters record component
      thrownTypes - the value for the thrownTypes record component
      annotations - the value for the annotations record component
      modifiers - the value for the modifiers record component
      constructor - the value for the constructor record component
      nativeType - the value for the nativeType record component
      overriddenMethods - the value for the overriddenMethods record component
      genericReturnType - the value for the genericReturnType record component
  • Method Details

    • resolvedReturnType

      public ScalaTypeData resolvedReturnType()
      The return type with the type variables of the declaring type bound as they were at the point of use: Book for find inherited through Repo[Book, Long]. returnType() stays the declared E, which is what the method compiles to and what an override of it has to be declared as.
      Returns:
      The generic return 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
    • returnType

      public ScalaTypeData returnType()
      Returns the value of the returnType record component.
      Returns:
      the value of the returnType record component
    • parameters

      public List<ScalaParameterData> parameters()
      Returns the value of the parameters record component.
      Returns:
      the value of the parameters record component
    • typeParameters

      public List<ScalaTypeData> typeParameters()
      Returns the value of the typeParameters record component.
      Returns:
      the value of the typeParameters record component
    • thrownTypes

      public List<ScalaTypeData> thrownTypes()
      Returns the value of the thrownTypes record component.
      Returns:
      the value of the thrownTypes 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
    • constructor

      public boolean constructor()
      Returns the value of the constructor record component.
      Returns:
      the value of the constructor 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
    • overriddenMethods

      public List<ScalaMethodData> overriddenMethods()
      Returns the value of the overriddenMethods record component.
      Returns:
      the value of the overriddenMethods record component
    • genericReturnType

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