karan/jReddit — pull request #86 by aliakhtar (2014-06-23 19:57:15+00:00)
Title: Getting paginated submissions, nested replies of comments, and PoliteRestClient for rate limited Rest Requests

I've made a few improvements that I needed for a project:

1) `Comment` had a string for replies. I've changed that to a `List` instead, to allow for nested replies to be fetched. I've also changed `CommentMapper` to map these nested comments correctly.

2) `Submissions.getSubmissions(String subreddit)` would only return the submissions found on the first page. I've changed this to return a `PaginationResult` to allow for pagination to occur. I've also included an example in `/examples` called `GetPaginatedTopics` which demonstrates how to use this. `Submissions.getSubmissions(String redditName, Popularity type, Page frontpage, User user)` could probably be rewritten to work in the same way, but I haven't been able to test it, so I'm not including that.

3) I'm including another rest client called `PoliteRestClient`, which ensures that no more than 1 request is made per 2 seconds, to comply with reddit's api access rules. It can be used optionally in place of `HttpRestClient`

I've not been able to write tests for these changes, but I have tested them in a project, and can confirm that they're working. Hope you find them useful.