File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
src/main/java/com/jnape/palatable/lambda/functions/specialized Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
9
9
- *** Breaking Change*** : ` Absent ` moved to ` semigroup.builtin ` package
10
10
- ` RightAny ` overload returns ` Monoid `
11
11
12
+ ### Added
13
+ - ` Predicate#predicate ` static factory method
14
+
12
15
## [ 3.1.0] - 2018-07-16
13
16
### Added
14
17
- ` Fn3-8 ` static factory overloads to aid in coercing lambdas
Original file line number Diff line number Diff line change @@ -82,4 +82,15 @@ default Predicate<A> or(java.util.function.Predicate<? super A> other) {
82
82
default Predicate <A > negate () {
83
83
return a -> !apply (a );
84
84
}
85
+
86
+ /**
87
+ * Static factory method to create a predicate from a function.
88
+ *
89
+ * @param predicate the function
90
+ * @param <A> the input type
91
+ * @return the predicate
92
+ */
93
+ static <A > Predicate <A > predicate (Function <? super A , Boolean > predicate ) {
94
+ return predicate ::apply ;
95
+ }
85
96
}
You can’t perform that action at this time.
0 commit comments