public class ServerResponse
extends java.lang.Object
| Constructor and Description |
|---|
ServerResponse(java.lang.String tag,
int statusCode)
Constructor method for the
ServerResponse class that allows for the instantiation
of a server response object as a direct result of a server call. |
ServerResponse(java.lang.String tag,
int statusCode,
io.branch.referral.BranchLinkData linkData)
Main constructor method for the
ServerResponse class that allows for the instantiation
of a server response object as a direct result of a server call. |
| Modifier and Type | Method and Description |
|---|---|
org.json.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. |
java.lang.String |
getFailReason()
Get the reason for failure if there any
|
io.branch.referral.BranchLinkData |
getLinkData()
Gets a
BranchLinkData object containing the data associated with the current Branch
link. |
org.json.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. |
int |
getStatusCode()
Gets the HttpStatus code of the current response.
|
java.lang.String |
getTag()
Gets the
String value of the Tag attribute of the current link. |
void |
setPost(java.lang.Object post)
Sets the post data attached to the current server request, as a generic
Object
instance. |
public ServerResponse(java.lang.String tag,
int statusCode)
Constructor method for the ServerResponse class that allows for the instantiation
of a server response object as a direct result of a server call. Omits BranchLinkData
, so is used where that value is null or unavailable.
tag - A String value of the Tag attribute of the current link.statusCode - Integer value of the HTTP status code.public ServerResponse(java.lang.String tag,
int statusCode,
io.branch.referral.BranchLinkData linkData)
Main constructor method for the ServerResponse class that allows for the instantiation
of a server response object as a direct result of a server call.
tag - A String value of the Tag attribute of the current link.statusCode - Integer value of the HTTP status code.linkData - A BranchLinkData object containing data attributes associated with a Branch link.public java.lang.String getTag()
Gets the String value of the Tag attribute of the current link.
String value of the Tag attribute of the current link.public int getStatusCode()
Gets the HttpStatus code of the current response.
Integer value of the HTTP status code.public void setPost(java.lang.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:
post - Generic Object instance containing post data associated with current
response.public org.json.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.
JSONObject containing the post data sent with a server request, or a null
value if the post data is not of the JSONObject type.public org.json.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.
JSONArray containing the post data sent with a server request, or a null
value if the post data is not of the JSONArray type.public io.branch.referral.BranchLinkData getLinkData()
Gets a BranchLinkData object containing the data associated with the current Branch
link.
BranchLinkData object containing data attributes associated with a Branch link.public java.lang.String getFailReason()
String value with failure reason