protected Predicate<CardRules> getCardRulesFieldPredicate( CardRulesPredicates.LeafNumber.CardField field) { int lowerValue = lowerBound.getValue(); int upperValue = upperBound.getValue(); boolean hasMin = lowerValue != minValue(); boolean hasMax = upperValue != maxValue(); Predicate<CardRules> pLower = hasMin ? new CardRulesPredicates.LeafNumber(field, ComparableOp.GT_OR_EQUAL, lowerValue) : null; Predicate<CardRules> pUpper = hasMax ? new CardRulesPredicates.LeafNumber(field, ComparableOp.LT_OR_EQUAL, upperValue) : null; return SFilterUtil.optimizedAnd(pLower, pUpper); }
@Override protected final Predicate<DeckProxy> buildPredicate() { return SFilterUtil.buildDeckColorFilter(buttonMap); }