public abstract class AbstractFlattrCallable<R> extends Object implements FlattrCallable<R>
FlattrCallable.| Constructor and Description |
|---|
AbstractFlattrCallable() |
| Modifier and Type | Method and Description |
|---|---|
R |
call() |
abstract R |
call(FlattrService service)
Calls the appropriate method at the service and returns the result.
|
protected FlattrService |
createFlattrService(AccessToken token)
Creates a new
FlattrService for the given AccessToken. |
RateLimit |
getRateLimit()
Returns the
RateLimit state after this callable was successfully executed,
or null if the call failed or was not invoked yet. |
R |
getResult()
Gets the result of the last call.
|
boolean |
isFullMode() |
void |
setAccessToken(AccessToken token)
Sets the
AccessToken to be used if the call requires authorization. |
void |
setAccessToken(String token)
Shortcut to set an
AccessToken. |
void |
setFullMode(boolean full)
Sets the full mode to be used when the call is executed.
|
public AbstractFlattrCallable()
public void setAccessToken(AccessToken token)
FlattrCallableAccessToken to be used if the call requires authorization.setAccessToken in interface FlattrCallable<R>token - AccessToken, or null if no authorization is neededpublic void setAccessToken(String token)
FlattrCallableAccessToken.setAccessToken in interface FlattrCallable<R>token - Access token, or null if no authorization is neededpublic RateLimit getRateLimit()
RateLimit state after this callable was successfully executed,
or null if the call failed or was not invoked yet.public void setFullMode(boolean full)
full - full modepublic boolean isFullMode()
protected FlattrService createFlattrService(AccessToken token)
FlattrService for the given AccessToken. Can be
overridden by subclasses if the FlattrService needs a special
configuration.token - AccessTokenFlattrService that was createdpublic abstract R call(FlattrService service) throws Exception
service - Preconfigured FlattrService to be invokedExceptionpublic R getResult()
FlattrCallablegetResult in interface FlattrCallable<R>Copyright © 2010–2017. All rights reserved.