Record Class ELMethodExpressionDefinition

java.lang.Object
java.lang.Record
io.micronaut.el.processor.compiler.ELMethodExpressionDefinition
Record Components:
expression - The expression string
returnType - The expected return type
inferred - Whether the type was inferred from the static type of the expression rather than declared
parameterTypes - The expected parameter types
constantName - The name of the generated constant
node - The parsed expression

@Internal public record ELMethodExpressionDefinition(String expression, @Nullable io.micronaut.inject.ast.ClassElement returnType, boolean inferred, List<io.micronaut.inject.ast.ClassElement> parameterTypes, String constantName, ELNode node) extends Record
A method expression declared with io.micronaut.el.annotation.ELMethodExpression.
Since:
1.0
Author:
Denis Stepanov
  • Constructor Details

    • ELMethodExpressionDefinition

      public ELMethodExpressionDefinition(String expression, @Nullable io.micronaut.inject.ast.ClassElement returnType, boolean inferred, List<io.micronaut.inject.ast.ClassElement> parameterTypes, String constantName, ELNode node)
      Creates an instance of a ELMethodExpressionDefinition record class.
      Parameters:
      expression - the value for the expression record component
      returnType - the value for the returnType record component
      inferred - the value for the inferred record component
      parameterTypes - the value for the parameterTypes record component
      constantName - the value for the constantName record component
      node - the value for the node record component
  • Method Details

    • inferring

      public ELMethodExpressionDefinition inferring(io.micronaut.inject.ast.ClassElement type)
      A definition whose expected return type was omitted, resolved to the static type of the invocation.
      Parameters:
      type - The inferred type
      Returns:
      The definition with the type
    • requireReturnType

      public io.micronaut.inject.ast.ClassElement requireReturnType()
      Returns:
      The return type, which inference has resolved by the time a writer reads it
    • 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.
    • expression

      public String expression()
      Returns the value of the expression record component.
      Returns:
      the value of the expression record component
    • returnType

      public @Nullable io.micronaut.inject.ast.ClassElement returnType()
      Returns the value of the returnType record component.
      Returns:
      the value of the returnType record component
    • inferred

      public boolean inferred()
      Returns the value of the inferred record component.
      Returns:
      the value of the inferred record component
    • parameterTypes

      public List<io.micronaut.inject.ast.ClassElement> parameterTypes()
      Returns the value of the parameterTypes record component.
      Returns:
      the value of the parameterTypes record component
    • constantName

      public String constantName()
      Returns the value of the constantName record component.
      Returns:
      the value of the constantName record component
    • node

      public ELNode node()
      Returns the value of the node record component.
      Returns:
      the value of the node record component