use of com.hazelcast.query.impl.QueryEntry in project hazelcast by hazelcast.
the class PagingPredicateTest method pagingPredicateWithEmployeeObjectTest.
@SuppressWarnings({ "SameParameterValue", "unchecked" })
private List<Employee> pagingPredicateWithEmployeeObjectTest(IMap<Integer, Employee> map, Predicate<Integer, Employee> predicate, int pageSize) {
PagingPredicate<Integer, Employee> pagingPredicate = Predicates.pagingPredicate(predicate, pageSize);
Set<Map.Entry<Integer, Employee>> set;
List<Employee> results = new ArrayList<>();
do {
set = map.entrySet(pagingPredicate);
for (Map.Entry<Integer, Employee> entry : set) {
Employee e = entry.getValue();
InternalSerializationService ss = (InternalSerializationService) serializationService;
QueryEntry qe = new QueryEntry(ss, ss.toData(e.getId()), e, Extractors.newBuilder(ss).build());
assertTrue(predicate.apply(qe));
results.add(e);
}
pagingPredicate.nextPage();
} while (!set.isEmpty());
return results;
}
Aggregations