Esempio n. 1
0
  /**
   * Sets JEXL context variable value and returns {@code this}.
   *
   * @param var Name of the variable in JEXL context (new or existing).
   * @param val Value to be set or overridden in JEXL context.
   * @return This predicate so that this call can be chained.
   */
  public GridJexlPredicate2<T1, T2> with(String var, @Nullable Object val) {
    A.notNull(var, "var");

    map.put(var, val);

    return this;
  }
Esempio n. 2
0
  /**
   * Creates JEXL predicate with given parameters.
   *
   * @param exprStr JEXL boolean expression. Note that non-boolean return value will evaluate this
   *     predicate to {@code false}.
   * @param var1 Name of the 1st bound variable in JEXL expression.
   * @param var2 Name of the 2nd bound variable in JEXL expression.
   */
  public GridJexlPredicate2(String exprStr, String var1, String var2) {
    A.notNull(exprStr, "exprStr", var1, "var1", var2, "var2");

    this.exprStr = exprStr;
    this.var1 = var1;
    this.var2 = var2;
  }