Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Implemented Functional Interface Filter

Joined
Dec 10, 2014
Messages
3,332
It'd be nice to be able to use lambdas in our .filter() in queries, what I suggest is adding a functional interface alongside the current abstract class, so we can use lambdas without breaking legacy code :D

@Cloud pls
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
Want want want. I wanted this before but never asked for it for some reason. SUPPORT
 
Joined
Dec 10, 2014
Messages
3,332
Want want want. I wanted this before but never asked for it for some reason. SUPPORT
I feel like a lot of us have wanted it for ages, but afaik one of the main reasons it wasn't added was because if you replace the old filter with the new one, a lot of bots would break. BUT, if you implement them alongside each other, there's no harm :D
 
Mod Automation
Joined
Jul 26, 2013
Messages
3,053
Support immensely. We had to create filters, because at the time we weren't comfortable forcing Java 8. That has since changed, so there shouldn't be anything blocking us from doing this. We can deprecate the filter pattern, but leave it in for now.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
I feel like a lot of us have wanted it for ages, but afaik one of the main reasons it wasn't added was because if you replace the old filter with the new one, a lot of bots would break. BUT, if you implement them alongside each other, there's no harm :D
Support immensely. We had to create filters, because at the time we weren't comfortable forcing Java 8. That has since changed, so there shouldn't be anything blocking us from doing this. We can deprecate the filter pattern, but leave it in for now.
As a start, I've gone ahead and added an overload for QueryBuilder.filter(Predicate). In addition, the code now internally uses a predicate instead of a filter, and the filter class has had a toPredicate method added to it.
 
Top