1 package com.github.davidmoten.rx2;
2
3 import com.github.davidmoten.rx2.exceptions.ThrowingException;
4
5 import io.reactivex.functions.BiPredicate;
6
7 public final class BiPredicates {
8
9 private BiPredicates() {
10
11 }
12
13 public static <T, R> BiPredicate<T, R> alwaysTrue() {
14
15 return new BiPredicate<T, R>() {
16
17 @Override
18 public boolean test(T t1, R t2) throws Exception {
19 return true;
20 }
21 };
22 }
23
24 public static <T, R> BiPredicate<T, R> alwaysFalse() {
25
26 return new BiPredicate<T, R>() {
27
28 @Override
29 public boolean test(T t1, R t2) throws Exception {
30 return false;
31 }
32 };
33 }
34
35 public static <T, R> BiPredicate<T, R> throwing() {
36
37 return new BiPredicate<T, R>() {
38
39 @Override
40 public boolean test(T t1, R t2) throws Exception {
41 throw new ThrowingException();
42 }
43 };
44
45 }
46
47 }