Package net.dv8tion.jda.api.requests
Class Response
- java.lang.Object
-
- net.dv8tion.jda.api.requests.Response
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class Response extends Object implements Closeable
-
-
Field Summary
Fields Modifier and Type Field Description intcodestatic intERROR_CODEstatic StringERROR_MESSAGEstatic IOFunction<BufferedReader,DataArray>JSON_SERIALIZE_ARRAYstatic IOFunction<BufferedReader,DataObject>JSON_SERIALIZE_OBJECTStringmessagelongretryAfter
-
Constructor Summary
Constructors Constructor Description Response(long retryAfter, Set<String> cfRays)Response(Exception exception, Set<String> cfRays)Response(Response response, int code, String message, long retryAfter, Set<String> cfRays)Response(Response response, long retryAfter, Set<String> cfRays)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()<T> Tget(Class<T> clazz, IOFunction<BufferedReader,T> parser)DataArraygetArray()Set<String>getCFRays()ExceptiongetException()DataObjectgetObject()ResponsegetRawResponse()StringgetString()booleanisError()booleanisOk()booleanisRateLimit()Optional<DataArray>optArray()Optional<DataObject>optObject()StringtoString()
-
-
-
Field Detail
-
ERROR_CODE
public static final int ERROR_CODE
- See Also:
- Constant Field Values
-
ERROR_MESSAGE
public static final String ERROR_MESSAGE
- See Also:
- Constant Field Values
-
JSON_SERIALIZE_OBJECT
public static final IOFunction<BufferedReader,DataObject> JSON_SERIALIZE_OBJECT
-
JSON_SERIALIZE_ARRAY
public static final IOFunction<BufferedReader,DataArray> JSON_SERIALIZE_ARRAY
-
code
public final int code
-
message
public final String message
-
retryAfter
public final long retryAfter
-
-
Method Detail
-
getObject
@Nonnull public DataObject getObject()
-
optObject
@Nonnull public Optional<DataObject> optObject()
-
get
@Nonnull public <T> T get(Class<T> clazz, IOFunction<BufferedReader,T> parser)
-
isError
public boolean isError()
-
isOk
public boolean isOk()
-
isRateLimit
public boolean isRateLimit()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-