Package net.dv8tion.jda.api.requests
Class Response
- java.lang.Object
-
- net.dv8tion.jda.api.requests.Response
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class Response extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description int
code
static int
ERROR_CODE
static java.lang.String
ERROR_MESSAGE
static IOFunction<java.io.BufferedReader,DataArray>
JSON_SERIALIZE_ARRAY
static IOFunction<java.io.BufferedReader,DataObject>
JSON_SERIALIZE_OBJECT
java.lang.String
message
long
retryAfter
-
Constructor Summary
Constructors Constructor Description Response(long retryAfter, java.util.Set<java.lang.String> cfRays)
Response(java.lang.Exception exception, java.util.Set<java.lang.String> cfRays)
Response(Response response, int code, java.lang.String message, long retryAfter, java.util.Set<java.lang.String> cfRays)
Response(Response response, long retryAfter, java.util.Set<java.lang.String> cfRays)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
<T> T
get(java.lang.Class<T> clazz, IOFunction<java.io.BufferedReader,T> parser)
DataArray
getArray()
java.util.Set<java.lang.String>
getCFRays()
java.lang.Exception
getException()
DataObject
getObject()
Response
getRawResponse()
java.lang.String
getString()
boolean
isError()
boolean
isOk()
boolean
isRateLimit()
java.util.Optional<DataArray>
optArray()
java.util.Optional<DataObject>
optObject()
java.lang.String
toString()
-
-
-
Field Detail
-
ERROR_CODE
public static final int ERROR_CODE
- See Also:
- Constant Field Values
-
ERROR_MESSAGE
public static final java.lang.String ERROR_MESSAGE
- See Also:
- Constant Field Values
-
JSON_SERIALIZE_OBJECT
public static final IOFunction<java.io.BufferedReader,DataObject> JSON_SERIALIZE_OBJECT
-
JSON_SERIALIZE_ARRAY
public static final IOFunction<java.io.BufferedReader,DataArray> JSON_SERIALIZE_ARRAY
-
code
public final int code
-
message
public final java.lang.String message
-
retryAfter
public final long retryAfter
-
-
Constructor Detail
-
Response
public Response(@Nonnull java.lang.Exception exception, @Nonnull java.util.Set<java.lang.String> cfRays)
-
Response
public Response(@Nullable Response response, int code, @Nonnull java.lang.String message, long retryAfter, @Nonnull java.util.Set<java.lang.String> cfRays)
-
Response
public Response(long retryAfter, @Nonnull java.util.Set<java.lang.String> cfRays)
-
Response
public Response(@Nonnull Response response, long retryAfter, @Nonnull java.util.Set<java.lang.String> cfRays)
-
-
Method Detail
-
getArray
@Nonnull public DataArray getArray()
-
optArray
@Nonnull public java.util.Optional<DataArray> optArray()
-
getObject
@Nonnull public DataObject getObject()
-
optObject
@Nonnull public java.util.Optional<DataObject> optObject()
-
getString
@Nonnull public java.lang.String getString()
-
get
@Nonnull public <T> T get(java.lang.Class<T> clazz, IOFunction<java.io.BufferedReader,T> parser)
-
getRawResponse
@Nullable public Response getRawResponse()
-
getCFRays
@Nonnull public java.util.Set<java.lang.String> getCFRays()
-
getException
@Nullable public java.lang.Exception getException()
-
isError
public boolean isError()
-
isOk
public boolean isOk()
-
isRateLimit
public boolean isRateLimit()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-