Record Class ELExpressionDefinition

java.lang.Object
java.lang.Record
io.micronaut.el.processor.compiler.ELExpressionDefinition
Record Components:
expression - The expression string
expectedType - The expected type of the evaluation result
inferred - Whether the type was inferred from the static type of the expression rather than declared
constantName - The name of the generated constant
node - The parsed expression

@Internal public record ELExpressionDefinition(String expression, @Nullable io.micronaut.inject.ast.ClassElement expectedType, boolean inferred, String constantName, ELNode node) extends Record
A value expression declared with io.micronaut.el.annotation.ELExpression.
Since:
1.0
Author:
Denis Stepanov
  • Constructor Details

    • ELExpressionDefinition

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

    • inferring

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

      public io.micronaut.inject.ast.ClassElement requireExpectedType()
      Returns:
      The expected 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
    • expectedType

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

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