示例#1
0
文件: Is.java 项目: jbee/jadamant
 public static <T> Predicate<T> and(Predicate<T> left, Predicate<T> right) {
   if (left == TRUE) {
     return right;
   }
   if (right == TRUE) {
     return left;
   }
   return (left == FALSE || right == FALSE) ? Is.<T>false_() : new AndPredicate<T>(left, right);
 }
示例#2
0
文件: Is.java 项目: jbee/jadamant
 public static <T> Predicate<T> or(Predicate<T> left, Predicate<T> right) {
   if (left == FALSE) {
     return right;
   }
   if (right == FALSE) {
     return left;
   }
   return (left == TRUE || right == TRUE) ? Is.<T>true_() : new OrPredicate<T>(left, right);
 }