Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static <T,R> List<R> manipulateList(List<T> recList,
- Predicate<T> filterPredicate,
- Comparator<T> comparatorT,
- Function<T,R> mapTtoR,
- Optional<Long> limit,
- Optional<Long> offset) {
- return recList.stream()
- .filter(filterPredicate)
- .sorted(comparatorT)
- .skip(offset.orElse(0l))
- .limit(limit.orElse(Long.MAX_VALUE))
- .map(mapTtoR)
- .collect(Collectors.toList());
- }
Advertisement
Add Comment
Please, Sign In to add comment