public interface APIRequestFuture<T>
| Modifier and Type | Method and Description |
|---|---|
T |
awaitResponse()
Stops the current thread to wait for a response and returns it when it arrived
|
APIRequest<T> |
getAPIRequest() |
APIRequestError |
getError() |
Collection<APIRequestErrorHandler> |
getErrorHandlers() |
Collection<APIRequestFutureListener<T>> |
getListeners() |
T |
getResponse() |
boolean |
isCompleted() |
Boolean |
isSuccess() |
APIRequestFuture<T> |
onCompletion(APIRequestFutureListenerWithoutParams<T> listener) |
APIRequestFuture<T> |
onCompletion(APIRequestFutureListenerWithParams<T> listener) |
APIRequestFuture<T> |
onError(APIRequestErrorHandler handler) |
APIRequestFuture<T> |
removeErrorHandler(APIRequestErrorHandler errorHandler) |
APIRequestFuture<T> |
removeListener(APIRequestFutureListener<T> listener) |
APIRequestFuture<T> onCompletion(APIRequestFutureListenerWithoutParams<T> listener)
listener - Will be called if the APIRequest was successful and a response arrivedAPIRequestFuture<T> onCompletion(APIRequestFutureListenerWithParams<T> listener)
listener - Will be called if the APIRequest was successful and a response arrivedAPIRequestFuture<T> onError(APIRequestErrorHandler handler)
handler - Will be called when an error is returned because of an invalid requestboolean isCompleted()
Boolean isSuccess()
APIRequest<T> getAPIRequest()
T getResponse()
APIRequestError getError()
T awaitResponse() throws APIRequestError
APIRequestError - An APIRequestError might be thrown if the API request is not validAPIRequestFuture<T> removeListener(APIRequestFutureListener<T> listener)
listener - The given listener will not be notified about the APIRequest's responseAPIRequestFuture<T> removeErrorHandler(APIRequestErrorHandler errorHandler)
errorHandler - The given error handler will not be notified about an error returned to the APIRequestCollection<APIRequestFutureListener<T>> getListeners()
Collection<APIRequestErrorHandler> getErrorHandlers()
Copyright © 2025. All rights reserved.