An {@code int} specialized version of {@link #checkPrecondition(Object,
ContractConditionType)}.

@param value     The value
@param condition The predicate

@return value

@throws PreconditionViolationException If the predicate is false
491233
public static int checkPreconditionI(
    final int value,
    final ContractIntConditionType condition)
    throws PreconditionViolationException
  {
    return checkPreconditionI(
      value, condition.predicate(), condition.describer());
  }
642481
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "condition")
    public JAXBElement<ConditionType> createCondition(ConditionType value) {
        return new JAXBElement<ConditionType>(_Condition_QNAME, ConditionType.class, null, value);
    }
747096
public static <A> ConditionalConsequenceBuilder when( Variable<A> var, Predicate1<A> predicate ) {
        return when( FlowDSL.expr( var, predicate ) );
    }
645282
@Override
    public boolean checkCondition(IValue test) throws FilterException {
        Iterator iter = values.iterator();
        while (iter.hasNext()) {
            IValue value = (IValue) iter.next();
            if (value.containedBy(test)) {
                return true;
            }
        }
        return false;
    }
153250
public final Condition contains(final V value) {
        return new Condition().withComparisonOperator(CONTAINS).withAttributeValueList(convert(value));
    }
297086
@Override
    public boolean condition(Object input) {
        switch (type) {
            case AND:
                for (Condition c : conditions) {
                    boolean thisCond = c.condition(input);
                    if (!thisCond)
                        return false; //Any false -> AND is false
                }
                return true;
            case OR:
                for (Condition c : conditions) {
                    boolean thisCond = c.condition(input);
                    if (thisCond)
                        return true; //Any true -> OR is true
                }
                return false;
            case NOT:
                return !conditions[0].condition(input);
            case XOR:
                return conditions[0].condition(input) ^ conditions[1].condition(input);
            default:
                throw new RuntimeException("Unknown condition type: " + type);
        }
    }
1097479
@NotNull
    public OptionalInt filter(@NotNull IntPredicate predicate) {
        if (!isPresent()) return this;
        return predicate.test(value) ? this : OptionalInt.empty();
    }
1291398
public static ContractIntCondition conditionI(
    final IntPredicate condition,
    final IntFunction<String> describer)
  {
    return ContractIntCondition.of(condition, describer);
  }
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);
      }
    };
  }
1130299
public static Condition XOR(Condition first, Condition second) {
        return new BooleanCondition(Type.XOR, first, second);
    }
575645
public TypeValuePairType getTypeValuePair(String type, String value) {
        return getTypeValuePair(type, value.getBytes(StandardCharsets.UTF_8));
    }
1327157
public <T> Predicate<T> be(T value) {
    return create(obj -> Objects.equals(obj, value));
  }
278252
@Override
    public boolean condition(Object input) {
        Number n = (Number) input;
        switch (op) {
            case LessThan:
                return n.intValue() < value;
            case LessOrEqual:
                return n.intValue() <= value;
            case GreaterThan:
                return n.intValue() > value;
            case GreaterOrEqual:
                return n.intValue() >= value;
            case Equal:
                return n.intValue() == value;
            case NotEqual:
                return n.intValue() != value;
            case InSet:
                return set.contains(n.intValue());
            case NotInSet:
                return !set.contains(n.intValue());
            default:
                throw new RuntimeException("Unknown or not implemented op: " + op);
        }
    }
463542
public static <T> ContractCondition<T> condition(
    final Predicate<T> condition,
    final Function<T, String> describer)
  {
    return ContractCondition.of(condition, describer);
  }
423505
@Override
    public Predicate lt(Expression<? extends Number> arg0, Number arg1)
    {
        return new ComparisonPredicate(arg0, arg1, ConditionalOperator.LT);
    }
59419
public WhereCondition Val(Object val) {

        if ("?".equals(val)) {
            // question mark means WILDCARD for prepared statement
            mSgSQL.append(" ?");
        }
        else {
            mSgSQL.append("'");
            mSgSQL.append(val.toString());
            mSgSQL.append("'");
        }

        checkTokenOrderIsCorrect(ESqlToken.VALUE);
        return WhereCondition.this;
    }
418202
static Node getConditionExpression(Node n) {
    switch (n.getToken()) {
      case IF:
      case WHILE:
        return n.getFirstChild();
      case DO:
        return n.getLastChild();
      case FOR:
        return n.getSecondChild();
      case FOR_IN:
      case FOR_OF:
      case FOR_AWAIT_OF:
      case CASE:
        return null;
      default:
        break;
    }
    throw new IllegalArgumentException(n + " does not have a condition.");
  }