@Test public void binaryOr(){ assertEquals(Boolean.TRUE, PredicateUtil.binaryOr(Boolean.TRUE, Boolean.TRUE)); assertEquals(Boolean.TRUE, PredicateUtil.binaryOr(Boolean.TRUE, Boolean.FALSE)); assertEquals(Boolean.TRUE, PredicateUtil.binaryOr(Boolean.TRUE, null)); assertEquals(Boolean.TRUE, PredicateUtil.binaryOr(Boolean.FALSE, Boolean.TRUE)); assertEquals(Boolean.FALSE, PredicateUtil.binaryOr(Boolean.FALSE, Boolean.FALSE)); assertEquals(null, PredicateUtil.binaryOr(Boolean.FALSE, null)); assertEquals(Boolean.TRUE, PredicateUtil.binaryOr(null, Boolean.TRUE)); assertEquals(null, PredicateUtil.binaryOr(null, Boolean.FALSE)); assertEquals(null, PredicateUtil.binaryOr(null, null)); }
static public Boolean binaryOr(Boolean left, Boolean right){ if(left != null && left.booleanValue()){ return Boolean.TRUE; } else if(right != null && right.booleanValue()){ return Boolean.TRUE; } else if(left == null || right == null){ return null; } else { return Boolean.valueOf(left.booleanValue() | right.booleanValue()); } }
PredicateUtil { static public Boolean binaryOr(Boolean left, Boolean right){ if(left != null && left.booleanValue()){ return Boolean.TRUE; } else if(right != null && right.booleanValue()){ return Boolean.TRUE; } else if(left == null || right == null){ return null; } else { return Boolean.valueOf(left.booleanValue() | right.booleanValue()); } } }
PredicateUtil { static public Boolean binaryOr(Boolean left, Boolean right){ if(left != null && left.booleanValue()){ return Boolean.TRUE; } else if(right != null && right.booleanValue()){ return Boolean.TRUE; } else if(left == null || right == null){ return null; } else { return Boolean.valueOf(left.booleanValue() | right.booleanValue()); } } private  PredicateUtil(); }
PredicateUtil { static public Boolean binaryOr(Boolean left, Boolean right){ if(left != null && left.booleanValue()){ return Boolean.TRUE; } else if(right != null && right.booleanValue()){ return Boolean.TRUE; } else if(left == null || right == null){ return null; } else { return Boolean.valueOf(left.booleanValue() | right.booleanValue()); } } private  PredicateUtil(); static Predicate ensurePredicate(E hasPredicate); static Boolean evaluatePredicateContainer(E hasPredicate, EvaluationContext context); static Boolean evaluate(Predicate predicate, EvaluationContext context); static Boolean evaluateSimplePredicate(SimplePredicate simplePredicate, EvaluationContext context); static Boolean evaluateSimpleSetPredicate(SimpleSetPredicate simpleSetPredicate, EvaluationContext context); static Boolean evaluateCompoundPredicate(CompoundPredicate compoundPredicate, EvaluationContext context); static CompoundPredicateResult evaluateCompoundPredicateInternal(CompoundPredicate compoundPredicate, EvaluationContext context); static Boolean evaluateTrue(True truePredicate); static Boolean evaluateFalse(False falsePredicate); static Boolean evaluateJavaPredicate(JavaPredicate javaPredicate, EvaluationContext context); static Boolean binaryAnd(Boolean left, Boolean right); static Boolean binaryOr(Boolean left, Boolean right); static Boolean binaryXor(Boolean left, Boolean right); }
PredicateUtil { static public Boolean binaryOr(Boolean left, Boolean right){ if(left != null && left.booleanValue()){ return Boolean.TRUE; } else if(right != null && right.booleanValue()){ return Boolean.TRUE; } else if(left == null || right == null){ return null; } else { return Boolean.valueOf(left.booleanValue() | right.booleanValue()); } } private  PredicateUtil(); static Predicate ensurePredicate(E hasPredicate); static Boolean evaluatePredicateContainer(E hasPredicate, EvaluationContext context); static Boolean evaluate(Predicate predicate, EvaluationContext context); static Boolean evaluateSimplePredicate(SimplePredicate simplePredicate, EvaluationContext context); static Boolean evaluateSimpleSetPredicate(SimpleSetPredicate simpleSetPredicate, EvaluationContext context); static Boolean evaluateCompoundPredicate(CompoundPredicate compoundPredicate, EvaluationContext context); static CompoundPredicateResult evaluateCompoundPredicateInternal(CompoundPredicate compoundPredicate, EvaluationContext context); static Boolean evaluateTrue(True truePredicate); static Boolean evaluateFalse(False falsePredicate); static Boolean evaluateJavaPredicate(JavaPredicate javaPredicate, EvaluationContext context); static Boolean binaryAnd(Boolean left, Boolean right); static Boolean binaryOr(Boolean left, Boolean right); static Boolean binaryXor(Boolean left, Boolean right);  }