Class InMemoryBeanQuerySession<T>

java.lang.Object
org.apache.juneau.commons.beanquery.BeanQuerySession<T>
org.apache.juneau.commons.beanquery.InMemoryBeanQuerySession<T>
Type Parameters:
T - The row (bean) type.
All Implemented Interfaces:
AutoCloseable

public final class InMemoryBeanQuerySession<T> extends BeanQuerySession<T>
A BeanQuerySession over one in-memory collection.

The rows are filtered once, when the session is built, through the context guard and the session guard. Every call then searches, sorts and pages that scoped list. All $regex matching in one call shares one deadline (regexTimeout). close() is a no-op, but use try-with-resources anyway so the code does not change if the engine does.

Example:

try (InMemoryBeanQuerySession<Person> session = context.createSession() .rows(people) .guard(p -> p.getTenant().equals(tenant)) // This request's tenant only. .build()) { Page<Person> page = session.find(query); Counts counts = session.count(query); }

Since:
10.0.0