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/).
99- *** Breaking Change*** : ` Absent ` moved to ` semigroup.builtin ` package
1010- ` RightAny ` overload returns ` Monoid `
1111
12+ ### Added
13+ - ` Predicate#predicate ` static factory method
14+
1215## [ 3.1.0] - 2018-07-16
1316### Added
1417- ` 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) {
8282 default Predicate <A > negate () {
8383 return a -> !apply (a );
8484 }
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+ }
8596}
You can’t perform that action at this time.
0 commit comments