scripting/src/main/java/com/tersesystems/echopraxia/scripting/ScriptCondition.java
/**
   * Creates a condition from a passed in Tweakflow script.
   *
   * @param defaultValue the value to return if there's an exception in the flow.
   * @param script the script
   * @param reporter the reporter of any exceptions in the condition
   * @return the condition backed by script.
   */
Creates a condition from a passed in Tweakflow script.
@param defaultValue the value to return if there's an exception in the flow.
@param script the script
@param reporter the reporter of any exceptions in the condition
@return the condition backed by script.
Creates a condition from a passed in Tweakflow script . @param defaultValue the value to return if there ' s an exception in the flow . @param script the script @param reporter the reporter of any exceptions in the condition @return the condition backed by script .
public static Condition create(
      boolean defaultValue, String script, Consumer<Throwable> reporter) {
    ScriptHandle handle =
        new ScriptHandle() {
          @Override
          public void close() throws IOException {
          }
          @Override
          public boolean isInvalid() {
            return false;
          }
          @Override
          public String script() {
            return script;
          }
          @Override
          public String path() {
            return "<memory>";
          }
          @Override
          public void report(Throwable e) {
            reporter.accept(e);
          }
        };
    return create(defaultValue, handle);
  }
public static Condition create ( boolean defaultValue , String script , Consumer < Throwable > reporter ) { ScriptHandle handle = new ScriptHandle ( ) { @ Override public void close ( ) throws IOException { } @ Override public boolean isInvalid ( ) { return false ; } @ Override public String script ( ) { return script ; } @ Override public String path ( ) { return "<memory>" ; } @ Override public void report ( Throwable e ) { reporter . accept ( e ) ; } } ; return create ( defaultValue , handle ) ; }
Creates a condition from a passed in Tweakflow script.
Creates a condition from a passed in Tweakflow script .
// do nothing