예제 #1
0
  /**
   * Sets JEXL context variables' values and returns {@code this}.
   *
   * @param vals Set of tuples representing JEXL context to be bound. First element in the tuple
   *     represents the name and the second element represents its value in the context.
   * @return This predicate so that this call can be chained.
   */
  public GridJexlPredicate2<T1, T2> with(GridTuple2<String, Object>... vals) {
    for (GridTuple2<String, Object> t : vals) {
      map.put(t.get1(), t.get2());
    }

    return this;
  }
예제 #2
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;
  }