Created
January 11, 2013 16:13
-
-
Save secondsun/4511860 to your computer and use it in GitHub Desktop.
A brainstorm for fetching MetaData results for paging from a Pipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Pipe<T> { | |
//snip | |
/** | |
* These methods MUST add a result to a Map so that a paging context can be looked up | |
*/ | |
public List<T> read(); | |
public List<T> readWithFilter(ReadFilter filter); | |
/** | |
* If a result had a paging context, fetch the context. | |
*/ | |
public PagingContext getContext(List<T> result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implementations of Pipe will be free to choose how they extract the PagingContext and how they store it. A WeakHashMap is probably one of the better structures to use.