public final class TelegramQuery extends APIQuery<TelegramQuery,Void>
rateLimiter, resourceValuelogger| Constructor and Description |
|---|
TelegramQuery(String clientKey,
String telegramId,
String secretKey,
String... nations)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
TelegramQuery |
addListeners(TelegramSentListener... newListeners)
Registers new telegram event listeners.
|
protected String |
buildURL()
Generates a String URL based on the supplied values.
|
long |
estimatedDuration()
The estimated time it will take to send all of this query's telegrams, in
milliseconds.
|
<T extends Void> |
execute(Class<T> type)
Executes this query, returning any result.
|
protected RateLimiter |
getRateLimiter()
Returns the rate limiter to use in the makeRequest()-function.
|
TelegramQuery |
isRecruitment()
Ensures the telegram will be send as if it is a recruitment telegram.
|
protected String |
resourceString()
Gives the resource string of this Query, e.g.
|
protected <T extends Void> |
translateResponse(InputStream response,
Class<T> type)
Translates the stream response to the object this Query wishes to return
via its execute() function.
|
protected void |
validateQueryParameters()
Validates the query parameters before executing the query.
|
closeInputStreamQuietly, execute, makeRequestpublic TelegramQuery isRecruitment()
public TelegramQuery addListeners(TelegramSentListener... newListeners)
newListeners - the listeners to registerprotected String resourceString()
APIQueryresourceString in class APIQuery<TelegramQuery,Void>protected void validateQueryParameters()
AbstractQueryvalidateQueryParameters in class APIQuery<TelegramQuery,Void>protected <T extends Void> T translateResponse(InputStream response, Class<T> type)
AbstractQuerytranslateResponse in class AbstractQuery<TelegramQuery,Void>T - type to parse toresponse - the response to translatetype - type to parse topublic long estimatedDuration()
public <T extends Void> T execute(Class<T> type)
AbstractQueryexecute in class APIQuery<TelegramQuery,Void>T - the type to returntype - the type to returnprotected String buildURL()
AbstractQuerybuildURL in class APIQuery<TelegramQuery,Void>protected RateLimiter getRateLimiter()
APIQuerygetRateLimiter in class APIQuery<TelegramQuery,Void>Copyright © 2016. All rights reserved.