Skip to content

Instantly share code, notes, and snippets.

@sebastienblanc
Created January 15, 2013 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastienblanc/4538709 to your computer and use it in GitHub Desktop.
Save sebastienblanc/4538709 to your computer and use it in GitHub Desktop.
public interface PagedResult<T> {
List<T> next();
List<T> prev();
List<T> page(int offset, int limit);
}
//and the Async counterpart
public interface AsyncPagedResult<T> {
void next(Callback<List<T>> callback);
void prev(Callback<List<T>> callback);
void page(int offset, int limit, Callback<List<T>> callback);
public static interface Callback<U> {
public void onResult(U result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment