T
- The generic response type for this RestActionpublic static class RestAction.EmptyRestAction<T> extends RestAction<T>
RestAction
that is used to provide information that
has already been retrieved or generated so that another request does not need to be made to Discord.
RestAction.EmptyRestAction<T>
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor and Description |
---|
EmptyRestAction(T returnObj) |
Modifier and Type | Method and Description |
---|---|
T |
complete(boolean shouldQueue)
Blocks the current Thread and awaits the completion
of an
RestAction.submit() request. |
void |
queue(java.util.function.Consumer<T> success,
java.util.function.Consumer<java.lang.Throwable> failure)
Submits a Request for execution.
|
java.util.concurrent.Future<T> |
submit(boolean shouldQueue)
Submits a Request for execution and provides
an
Future representing
its completion task. |
public EmptyRestAction(T returnObj)
public void queue(java.util.function.Consumer<T> success, java.util.function.Consumer<java.lang.Throwable> failure)
RestAction
This method is asynchronous
queue
in class RestAction<T>
success
- The success callback that will be called at a convenient time
for the API. (can be null)failure
- The failure callback that will be called if the Request
encounters an exception at its execution point.public java.util.concurrent.Future<T> submit(boolean shouldQueue)
RestAction
Future
representing
its completion task.
submit
in class RestAction<T>
shouldQueue
- Whether the Request should automatically handle rate limitations. (default true)Future
task representing the completion promisepublic T complete(boolean shouldQueue)
RestAction
RestAction.submit()
request.
complete
in class RestAction<T>
shouldQueue
- Whether this should automatically handle rate limitations (default true)