Implemented Functional Interface Filter

Discussion in 'Client & Site Suggestions' started by SlashnHax, Jun 26, 2015.

  1. 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
    Aidden likes this.
  2. Want want want. I wanted this before but never asked for it for some reason. SUPPORT
  3. 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
  4. 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.
  5. 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.
    SlashnHax likes this.

Share This Page