Class Response

java.lang.Object
net.dv8tion.jda.api.requests.Response
All Implemented Interfaces:
Closeable, AutoCloseable

public class Response extends Object implements Closeable
Internal class used to represent HTTP responses or request failures.
  • Field Details

  • Constructor Details

    • Response

      public Response(@Nonnull Exception exception, @Nonnull Set<String> cfRays)
    • Response

      public Response(@Nullable okhttp3.Response response, int code, @Nonnull String message, long retryAfter, @Nonnull Set<String> cfRays)
    • Response

      public Response(long retryAfter, @Nonnull Set<String> cfRays)
    • Response

      public Response(@Nonnull okhttp3.Response response, long retryAfter, @Nonnull Set<String> cfRays)
  • Method Details

    • getArray

      @Nonnull public DataArray getArray()
    • optArray

      @Nonnull public Optional<DataArray> optArray()
    • getObject

      @Nonnull public DataObject getObject()
    • optObject

      @Nonnull public Optional<DataObject> optObject()
    • getString

      @Nonnull public String getString()
    • get

      @Nonnull public <T> T get(@Nonnull Class<T> clazz, @Nonnull IOFunction<BufferedReader, T> parser)
    • getRawResponse

      @Nullable public okhttp3.Response getRawResponse()
    • getCFRays

      @Nonnull public Set<String> getCFRays()
    • getException

      @Nullable public Exception getException()
    • isError

      public boolean isError()
    • isOk

      public boolean isOk()
    • isRateLimit

      public boolean isRateLimit()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable