@Test public void testCountFromNetwork() { TestNetworkQueryController networkController = new TestNetworkQueryController(); OfflineQueryController controller = new OfflineQueryController(null, networkController); ParseQuery.State<ParseObject> state = new ParseQuery.State.Builder<>("TestObject") .build(); controller.countAsync(state, null, null); networkController.verifyCount(); }
@Override public <T extends ParseObject> Task<Integer> countAsync( ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken) { if (state.isFromLocalDatastore()) { return offlineStore.countFromPinAsync(state.pinName(), state, user); } else { return networkController.countAsync(state, user, cancellationToken); } }
OfflineQueryController extends AbstractQueryController { @Override public <T extends ParseObject> Task<Integer> countAsync( ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken) { if (state.isFromLocalDatastore()) { return offlineStore.countFromPinAsync(state.pinName(), state, user); } else { return networkController.countAsync(state, user, cancellationToken); } } }
OfflineQueryController extends AbstractQueryController { @Override public <T extends ParseObject> Task<Integer> countAsync( ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken) { if (state.isFromLocalDatastore()) { return offlineStore.countFromPinAsync(state.pinName(), state, user); } else { return networkController.countAsync(state, user, cancellationToken); } } OfflineQueryController(OfflineStore store, ParseQueryController network); }
OfflineQueryController extends AbstractQueryController { @Override public <T extends ParseObject> Task<Integer> countAsync( ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken) { if (state.isFromLocalDatastore()) { return offlineStore.countFromPinAsync(state.pinName(), state, user); } else { return networkController.countAsync(state, user, cancellationToken); } } OfflineQueryController(OfflineStore store, ParseQueryController network); @Override Task<List<T>> findAsync(
            ParseQuery.State<T> state,
            ParseUser user,
            Task<Void> cancellationToken); @Override Task<Integer> countAsync(
            ParseQuery.State<T> state,
            ParseUser user,
            Task<Void> cancellationToken); }
OfflineQueryController extends AbstractQueryController { @Override public <T extends ParseObject> Task<Integer> countAsync( ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken) { if (state.isFromLocalDatastore()) { return offlineStore.countFromPinAsync(state.pinName(), state, user); } else { return networkController.countAsync(state, user, cancellationToken); } } OfflineQueryController(OfflineStore store, ParseQueryController network); @Override Task<List<T>> findAsync(
            ParseQuery.State<T> state,
            ParseUser user,
            Task<Void> cancellationToken); @Override Task<Integer> countAsync(
            ParseQuery.State<T> state,
            ParseUser user,
            Task<Void> cancellationToken);  }