-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Location of Issue:
https://dev.java/learn/lambdas/functional-interfaces/#using-specialized-predicates
The solution provided by the JDK is the same as for suppliers and consumers: specialized predicates. Along with Predicate<String> are three specialized interfaces: IntPredicate, LongPredicate, and DoublePredicate. Their abstract methods all follow the naming convention. Since they all return a boolean, they are just named test() and take an argument corresponding to the interface.
Description:
I'm having a hard time understanding why Predicate<String> is along with IntPredicate, LongPredicate and DoublePredicate. Was it meant to be Predicate<T>?
Suggested Fix:
Just like the Biconsumer section:
There are three specialized versions of the Predicate<T> interface to handle primitive types: IntPredicate, LongPredicate, and DoublePredicate. Their abstract methods all follow the naming convention. Since they all return a boolean, they are just named test() and take an argument corresponding to the interface.
Minor details:
In the biconsumer i expected to see a "same".
Their abstract methods all follow the naming convention.
Suggested Fix:
Their abstract methods all follow the same naming convention, mentioned at Using Specialized Suppliers.