public class TronaldClient
extends java.lang.Object
https://api.tronalddump.io Java client.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BASE_URL |
static java.text.DateFormat |
DATE_FORMAT |
| Constructor and Description |
|---|
TronaldClient() |
| Modifier and Type | Method and Description |
|---|---|
Quote |
getQuote(java.lang.String id)
Returns the quote for the given id.
|
Quote |
getRandomQuote()
Returns a random quote.
|
Quote |
getRandomQuote(java.lang.String tag)
Returns a random quote with the given tag.
|
java.util.List<java.lang.String> |
getTags()
Returns a list of available tags.
|
Page<Quote> |
search(java.lang.String query)
Returns a page of quotes for the given free text query.
|
Page<Quote> |
search(java.lang.String query,
int size)
Returns a page of quotes for the given free text query.
|
Page<Quote> |
search(java.lang.String query,
int page,
int size)
Returns a page of quotes for the given free text query.
|
Page<Quote> |
search(java.lang.String query,
Pageable pageable)
Returns a page of quotes for the given free text query.
|
public static final java.lang.String BASE_URL
public static final java.text.DateFormat DATE_FORMAT
public java.util.List<java.lang.String> getTags()
throws TronaldException
TronaldException - in case an error occurs while retrieving the tagspublic Quote getQuote(java.lang.String id) throws TronaldException
id - the unique quote id, not nullTronaldException - in case an error occurs while retrieving the quotepublic Quote getRandomQuote() throws TronaldException
TronaldException - in case an error occurs while retrieving the random quotepublic Quote getRandomQuote(java.lang.String tag) throws TronaldException
tag - the tagTronaldException - in case an error occurs while retrieving the random quotepublic Page<Quote> search(java.lang.String query) throws TronaldException
query - the free text query, not nullTronaldException - in case an error occurs while retrieving the random quotepublic Page<Quote> search(java.lang.String query, int size) throws TronaldException
query - the free text query, not nullsize - the page sizeTronaldException - in case an error occurs while retrieving the random quotepublic Page<Quote> search(java.lang.String query, int page, int size) throws TronaldException
query - the free text query, not nullpage - the page numbersize - the page sizeTronaldException - in case an error occurs while retrieving the random quotepublic Page<Quote> search(java.lang.String query, Pageable pageable) throws TronaldException
query - the free text query, not nullpageable - the pagination information, not nullTronaldException - in case an error occurs while retrieving the random quote