Package 

Class ServerResponse

    • Constructor Summary

      Constructors 
      Constructor Description
      ServerResponse(String tag, int statusCode, String requestId) Main constructor method for the ServerResponse class that allows for the instantiationof a server response object as a direct result of a server call.
    • Method Summary

      Modifier and Type Method Description
      String getTag() Gets the String value of the Tag attribute of the current link.
      int getStatusCode() Gets the HttpStatus code of the current response.
      void setPost(Object post) Sets the post data attached to the current server request, as a generic Object instance.
      JSONObject getObject() Checks whether the post data associated with the current request is an instance of a JSONObject object, and if so type-casts it to the corresponding class type.
      JSONArray getArray() Checks whether the post data associated with the current request is an instance of a JSONArray object, and if so type-casts it to the corresponding class type.
      String getFailReason() Get the reason for failure if there any
      • Methods inherited from class java.lang.Object

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

      • ServerResponse

        ServerResponse(String tag, int statusCode, String requestId)
        Main constructor method for the ServerResponse class that allows for the instantiationof a server response object as a direct result of a server call.
        Parameters:
        tag - A String value of the Tag attribute of the current link.
        statusCode - Integer value of the HTTP status code.
    • Method Detail

      • getStatusCode

         int getStatusCode()

        Gets the HttpStatus code of the current response.

      • setPost

         void setPost(Object post)

        Sets the post data attached to the current server request, as a generic Object instance. This object can be type-cast by other methods within this class:

        Parameters:
        post - Generic Object instance containing post data associated with currentresponse.
      • getObject

         JSONObject getObject()

        Checks whether the post data associated with the current request is an instance of a JSONObject object, and if so type-casts it to the corresponding class type.

      • getArray

         JSONArray getArray()

        Checks whether the post data associated with the current request is an instance of a JSONArray object, and if so type-casts it to the corresponding class type.