InMemoryQueryFilter

public final class InMemoryQueryFilter

A utility for performing in memory filtering on collections. This is not performance efficient, since its done on the application level. Filtering at the database level is advised.

Methods

filter

public static <T> List<T> filter(Collection<T> objects, QueryParams queryParams)

Filters the provided collection based on the provided query params.

Parameters:
  • objects – the collection to filter
  • queryParams – the query params with the ordering and paging information to apply
  • <T> – the type of the filtered collection
Returns:

the filtered, ordered list of objects from the original collection