Create a rule: predicate(conditions) => new state(results)

@param conditions conditions
@param results    results

@return rule
320030
public static Rule conditionsRule(final Set<Condition> conditions, final Map<String, String> results) {
        return conditionsRule(conditions, States.state(results));
    }
640899
public static ConditionMessage of(Collection<? extends ConditionMessage> messages) {
		ConditionMessage result = new ConditionMessage();
		if (messages != null) {
			for (ConditionMessage message : messages) {
				result = new ConditionMessage(result, message.toString());
			}
		}
		return result;
	}
444004
public void add(Collection<SyntheticsAlertCondition> conditions)
    {
        for(SyntheticsAlertCondition condition : conditions)
            this.conditions.put(condition.getId(), condition);
    }
342220
private void addPredicates(List<Predicate> newPredicates) {
    for(Predicate newPredicate : newPredicates) {
      if(this.predicates == null) {
        this.predicates = newPredicate;
      } else {
        this.predicates = new And(this.predicates, newPredicate);
      }
    }
  }
338212
public static <T extends Comparable<? super T>> Predicates<T> betweenInclusiveFrom(T from, T to)
    {
        Predicates.failIfDifferentTypes(from, to);
        return new BetweenInclusiveFrom<T>(from, to);
    }
491521
public Condition[] wrap(Condition... conditions){
		final Condition[] clonedConditions = new Condition[conditions.length];
		if(ArrayUtil.isNotEmpty(conditions)) {
			Condition clonedCondition;
			for(int i = 0; i < conditions.length; i++) {
				clonedCondition = conditions[i].clone();
				clonedCondition.setField(wrap(clonedCondition.getField()));
				clonedConditions[i] = clonedCondition;
			}
		}
		
		return clonedConditions;
	}
696682
public ValidationPlanResult append(Collection<ValidationResult> results) {
		if (results == null) {
			return this;
		}
		for (ValidationResult message : results) {
			addResult(message);
		}
		return this;
	}
1168972
@SuppressWarnings("unchecked")
  public S handleIf(BiPredicate<R, ? extends Throwable> resultPredicate) {
    Assert.notNull(resultPredicate, "resultPredicate");
    failuresChecked = true;
    failureConditions.add((BiPredicate<R, Throwable>) resultPredicate);
    return (S) this;
  }
365595
public static Rule conditionsRule(final Condition condition, StateObj result) {
        HashSet<Condition> conditions = new HashSet<>();
        conditions.add(condition);
        return conditionsRule(conditions, result);
    }
1158481
public static <T> Function<T, Boolean> forPredicate (final Predicate<T> predicate)
    {
        return new Function<T, Boolean>() {
            public Boolean apply (T arg) {
                return predicate.apply(arg);
            }
        };
    }
99497
static <R> BiPredicate<R, Throwable> resultPredicateFor(R result) {
    return (t, u) -> Objects.equals(result, t);
  }
760409
@Nonnull
  public static <T> Predicate<T> predicate(@Nonnull final Function<T, Boolean> predicate) {
    return predicate::apply;
  }
699465
public static function all($conditions=null)
    {
        self::_checkLoaded();

        $builder = self::_makeBuilder();
        $builder->fields  = self::extractColumns();
        $vals    = null;

        if ($conditions) {
            $builder->where = self::_extractWhereConditions($conditions);
            $vals           = self::extractWhereValues($conditions);
        }
        return new Collection($builder, $vals, get_called_class());
    }
727793
public SqlBuilder on(LogicalOperator logicalOperator, Condition... conditions) {
		if (ArrayUtil.isNotEmpty(conditions)) {
			if (null != wrapper) {
				// 包装字段名
				conditions = wrapper.wrap(conditions);
			}
			on(buildCondition(logicalOperator, conditions));
		}

		return this;
	}
355111
public function andHaving(...$conditions) : self
    {
        $this->havingConditions = $this->conditionalQueryBuilder->addConditionToClause(
            $this->havingConditions, 'AND', ...$this->createConditionExpressions($conditions)
        );

        return $this;
    }
1073638
public Choice<T> condition(final Predicate<? super T> predicate) {
    checkNotNull(predicate);
    final Choice<T> thisChoice = this;
    return new Choice<T>() {
      @Override
      protected Iterator<T> iterator() {
        return Iterators.filter(thisChoice.iterator(), predicate);
      }

      @Override
      public String toString() {
        return String.format("%s.condition(%s)", thisChoice, predicate);
      }
    };
  }
906675
public static <S, D> Condition<S, D> and(Condition<S, D> condition1, Condition<S, D> condition2) {
    Assert.notNull(condition1, "condition1");
    Assert.notNull(condition2, "condition2");
    return new AndCondition<S, D>(condition1, condition2);
  }