Class ApiResponse


  • public class ApiResponse
    extends java.lang.Object
    This class represents a response from the API, received through GreenProxy server.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      org.json.JSONObject data
      The response body as JSON.
      java.lang.String errorMessage
      The response body.
      boolean isSuccess
      The status of the response from the GreenProxy forward proxy server.
    • Constructor Summary

      Constructors 
      Constructor Description
      ApiResponse​(boolean isSuccess, java.lang.String errorMessage, java.lang.String data)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isGraphQLResponseError()
      Checks if the response from the GraphQL server is successful.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • isSuccess

        public final boolean isSuccess
        The status of the response from the GreenProxy forward proxy server.
      • errorMessage

        public final java.lang.String errorMessage
        The response body.
      • data

        public final org.json.JSONObject data
        The response body as JSON.
    • Constructor Detail

      • ApiResponse

        public ApiResponse​(boolean isSuccess,
                           java.lang.String errorMessage,
                           java.lang.String data)
        Constructor.
        Parameters:
        isSuccess - The status of the response.
        errorMessage - The response body.
        data - The response body as JSON.
    • Method Detail

      • isGraphQLResponseError

        public boolean isGraphQLResponseError()
        Checks if the response from the GraphQL server is successful.
        Returns:
        True if the response is successful, false otherwise.