Class GraalJsEvaluator<T>

java.lang.Object
io.nosqlbench.engine.api.scripting.GraalJsEvaluator<T>
All Implemented Interfaces:
ExprEvaluator<T>

public class GraalJsEvaluator<T> extends Object implements ExprEvaluator<T>
  • Constructor Details

    • GraalJsEvaluator

      public GraalJsEvaluator(Class<T> resultType)
  • Method Details

    • eval

      public T eval()
      Description copied from interface: ExprEvaluator
      Evaluate the provided script, returning the value that it yields
      Specified by:
      eval in interface ExprEvaluator<T>
      Returns:
      An object of type T
    • script

      public ExprEvaluator<T> script(String scriptText)
      Specified by:
      script in interface ExprEvaluator<T>
      Parameters:
      scriptText - script text
      Returns:
      this ExprEvaluator, for method chaining
    • put

      public ExprEvaluator<T> put(String varName, Object var)
      Description copied from interface: ExprEvaluator
      Set the variable environment of the evaluator
      Specified by:
      put in interface ExprEvaluator<T>
      Parameters:
      varName - the variable name to add to the environment
      var - the object to bind to the varname
      Returns:
      this ExprEvaluator, for method chaining