Package net.dv8tion.jda.api.requests
Class Request<T>
- java.lang.Object
-
- net.dv8tion.jda.api.requests.Request<T>
-
public class Request<T> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Request(net.dv8tion.jda.internal.requests.RestActionImpl<T> restAction, java.util.function.Consumer<? super T> onSuccess, java.util.function.Consumer<? super java.lang.Throwable> onFailure, java.util.function.BooleanSupplier checks, boolean shouldQueue, RequestBody body, java.lang.Object rawBody, long deadline, boolean priority, net.dv8tion.jda.internal.requests.Route.CompiledRoute route, org.apache.commons.collections4.map.CaseInsensitiveMap<java.lang.String,java.lang.String> headers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
RequestBody
getBody()
org.apache.commons.collections4.map.CaseInsensitiveMap<java.lang.String,java.lang.String>
getHeaders()
net.dv8tion.jda.internal.JDAImpl
getJDA()
java.util.function.Consumer<? super java.lang.Throwable>
getOnFailure()
java.util.function.Consumer<? super T>
getOnSuccess()
java.lang.Object
getRawBody()
RestAction<T>
getRestAction()
net.dv8tion.jda.internal.requests.Route.CompiledRoute
getRoute()
void
handleResponse(Response response)
boolean
isCancelled()
boolean
isPriority()
boolean
isSkipped()
void
onCancelled()
void
onFailure(java.lang.Throwable failException)
void
onFailure(Response response)
void
onSuccess(T successObj)
void
onTimeout()
boolean
shouldQueue()
-
-
-
Constructor Detail
-
Request
public Request(net.dv8tion.jda.internal.requests.RestActionImpl<T> restAction, java.util.function.Consumer<? super T> onSuccess, java.util.function.Consumer<? super java.lang.Throwable> onFailure, java.util.function.BooleanSupplier checks, boolean shouldQueue, RequestBody body, java.lang.Object rawBody, long deadline, boolean priority, net.dv8tion.jda.internal.requests.Route.CompiledRoute route, org.apache.commons.collections4.map.CaseInsensitiveMap<java.lang.String,java.lang.String> headers)
-
-
Method Detail
-
onSuccess
public void onSuccess(T successObj)
-
onFailure
public void onFailure(Response response)
-
onFailure
public void onFailure(java.lang.Throwable failException)
-
onCancelled
public void onCancelled()
-
onTimeout
public void onTimeout()
-
getJDA
@Nonnull public net.dv8tion.jda.internal.JDAImpl getJDA()
-
getRestAction
@Nonnull public RestAction<T> getRestAction()
-
getOnSuccess
@Nonnull public java.util.function.Consumer<? super T> getOnSuccess()
-
getOnFailure
@Nonnull public java.util.function.Consumer<? super java.lang.Throwable> getOnFailure()
-
isPriority
public boolean isPriority()
-
isSkipped
public boolean isSkipped()
-
getHeaders
@Nullable public org.apache.commons.collections4.map.CaseInsensitiveMap<java.lang.String,java.lang.String> getHeaders()
-
getRoute
@Nonnull public net.dv8tion.jda.internal.requests.Route.CompiledRoute getRoute()
-
getBody
@Nullable public RequestBody getBody()
-
getRawBody
@Nullable public java.lang.Object getRawBody()
-
shouldQueue
public boolean shouldQueue()
-
cancel
public void cancel()
-
isCancelled
public boolean isCancelled()
-
handleResponse
public void handleResponse(@Nonnull Response response)
-
-