Class FunctionCall.Argument

java.lang.Object
nz.org.riskscape.rl.ast.FunctionCall.Argument
Enclosing class:
FunctionCall

public static final class FunctionCall.Argument extends Object
  • Constructor Details

  • Method Details

    • getName

      public Optional<String> getName()
    • getNameToken

      public Optional<Token> getNameToken()
    • appendSource

      public void appendSource(StringBuilder appendTo)
    • toSource

      public String toSource()
    • evaluateConstant

      public <T> ResultOrProblems<T> evaluateConstant(RealizationContext context, Class<T> requiredJavaType, Type requiredType)

      Attempts to realize and evaluate this argument's expression against an empty Struct, returning useful problems if the expression wasn't constant or if the returned type doesn't match the expected java type.

      ExpressionRealizer.realizeConstant(Expression) has more details.

      Type Parameters:
      T - the expected object
      Parameters:
      requiredJavaType - the java type that we expect the expression to yield. Checked against the expression's return type, not the actual constant value's class type.
      requiredType - a riskscape type to use in any error message that's generated
    • getExpression

      public Expression getExpression()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object