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 int
code
static int
ERROR_CODE
static String
ERROR_MESSAGE
static IOFunction<BufferedReader,DataArray>
JSON_SERIALIZE_ARRAY
static IOFunction<BufferedReader,DataObject>
JSON_SERIALIZE_OBJECT
String
message
long
retryAfter
-
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 void
close()
<T> T
get(Class<T> clazz, IOFunction<BufferedReader,T> parser)
DataArray
getArray()
Set<String>
getCFRays()
Exception
getException()
DataObject
getObject()
Response
getRawResponse()
String
getString()
boolean
isError()
boolean
isOk()
boolean
isRateLimit()
Optional<DataArray>
optArray()
Optional<DataObject>
optObject()
String
toString()
-
-
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-