Stream<T> rowsToPush;
- if (getDataSource() instanceof InMemoryDataSource) {
+ if (getDataSource().isInMemory()) {
// We can safely request all the data when in memory
// FIXME: sorted and filter.
rowsToPush = getDataSource().apply(new Query()).skip(offset)
import java.util.function.Function;
import java.util.stream.Stream;
-import com.vaadin.tokka.event.Registration;
-
/**
* Minimal DataSource API for communication between the DataProvider and a back
* end service.
*/
DataSource<T, SORT> sortingBy(SORT sortOrder);
+ /**
+ * Gets whether the DataSource content all available in memory or does it
+ * use some external backend.
+ *
+ * @return {@code true} if all data is in memory; {@code false} if not
+ */
+ boolean isInMemory();
+
/**
* This method creates a new {@link InMemoryDataSource} from a given
* Collection. The InMemoryDataSource creates a protective List copy of all