117118119120121122123124125126127
handleComparator(); if (predicates.size() == 1) { BasePredicate predicate = predicates.get(0); if (not) { predicate = new NotPredicate(predicate); not = false; } return predicate; } throw new IllegalStateException("Can't return a predicate.");
251252253254255256257258259260261
handleComparator(); if (predicates.size() == 1) { Predicate predicate = predicates.get(0); if (not) { predicate = new NotPredicate(predicate); not = false; } return predicate; } throw new IllegalStateException("Can't return a predicate.");
58596061626364
} @Override public Predicate toPredicate() throws InvalidQueryException { //todo: remove need to down cast to BasePredicate return new NotPredicate((BasePredicate) getRightOperand().toPredicate()); }
51525354555657
return 3; } @Override public Predicate toPredicate(Predicate left, Predicate right) { return new NotPredicate((BasePredicate) right); }
39404142434445
return TYPE.NOT_EQUAL; } @Override public Predicate toPredicate(String prop, String val) { return new NotPredicate(new EqualsPredicate<String>(prop, val)); }
50515253545556
return 3; } @Override public Predicate toPredicate(Predicate left, Predicate right) { return new NotPredicate(right); }
56575859606162
} } @Override public Predicate toPredicate() throws InvalidQueryException { return new NotPredicate(getRightOperand().toPredicate()); }
373839404142434445
} @Test public void testToPredicate() { EqualsPredicate p = new EqualsPredicate<String>("prop", "val"); NotPredicate notPredicate = new NotPredicate(p); assertEquals(notPredicate, new NotOperator(1).toPredicate(null, p)); }
3637383940414243
assertEquals("NotEqualsOperator", new NotEqualsOperator().getName()); } @Test public void testToPredicate() { assertEquals(new NotPredicate(new EqualsPredicate<String>("prop", "val")), new NotEqualsOperator().toPredicate("prop", "val")); }