Predicates?
Brian Goetz
brian.goetz at oracle.com
Thu Apr 18 12:12:25 PDT 2013
We actually have one which we're considering getting rid of :)
The ones you outline are fairly low-value; they make tons of sense in a
world when inner classes are your only tool, but
() -> false
is more compact and more efficient and just as clear as
Predicates.alwaysFalse()
So our approach is to mostly avoid such trivial conveniences.
On 4/18/2013 2:38 PM, Michael Nascimento wrote:
> Hi folks,
>
> Have you already considered a Predicates class / static methods in
> Predicate with useful methods such as alwaysTrue(), alwaysFalse(),
> isNull() etc?
>
> Something like Predicates in Guava:
>
> http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Predicates.html
>
> Regards,
> Michael
>
More information about the lambda-dev
mailing list