Class EmptyAsyncRequest<T>
java.lang.Object
io.github.matyrobbrt.curseforgeapi.request.async.EmptyAsyncRequest<T>
- All Implemented Interfaces:
AsyncRequest<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.matyrobbrt.curseforgeapi.request.AsyncRequest
AsyncRequest.EmptyRequestException -
Field Summary
FieldsFields inherited from interface io.github.matyrobbrt.curseforgeapi.request.AsyncRequest
LOGGER -
Method Summary
Modifier and TypeMethodDescription<U> AsyncRequest<U>flatMap(Function<? super T, ? extends AsyncRequest<U>> mapper) Intermediate operator that returns a modifiedAsyncRequest.get()Completes this request by blocking the current thread until the value is returned, and then returning it.<U> AsyncRequest<U>Maps this requestvoidQueues the action for later completion.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.matyrobbrt.curseforgeapi.request.AsyncRequest
and, flatMapWithException, mapWithException, queue, queue
-
Field Details
-
INSTANCE
-
-
Method Details
-
map
Description copied from interface:AsyncRequestMaps this request- Specified by:
mapin interfaceAsyncRequest<T>- Type Parameters:
U- the new type of the request- Parameters:
mapper- the mapper to use- Returns:
- the request
-
flatMap
Description copied from interface:AsyncRequestIntermediate operator that returns a modifiedAsyncRequest.- Specified by:
flatMapin interfaceAsyncRequest<T>- Returns:
AsyncRequestfor the mapped type- See Also:
-
get
Description copied from interface:AsyncRequestCompletes this request by blocking the current thread until the value is returned, and then returning it.- Specified by:
getin interfaceAsyncRequest<T>- Returns:
- the value returned by the request
- Throws:
InterruptedExceptionExecutionException
-
queue
Description copied from interface:AsyncRequestQueues the action for later completion.- Specified by:
queuein interfaceAsyncRequest<T>- Parameters:
onSuccess- the consumer to run when the action succeededonFailure- the consumer to run when the action fails, or is empty (it fails with theAsyncRequest.EmptyRequestException)
-