-
public class ServerResponseClass providing the structure of a HTTP response as recieved from the Branch API.
Supports the following methods:
-
-
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 StringgetTag()Gets the String value of the Tag attribute of the current link. intgetStatusCode()Gets the HttpStatus code of the current response. voidsetPost(Object post)Sets the post data attached to the current server request, as a generic Object instance. JSONObjectgetObject()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. JSONArraygetArray()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. StringgetFailReason()Get the reason for failure if there any -
-
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.
-
-
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.
-
getFailReason
String getFailReason()
Get the reason for failure if there any
-
-
-
-