|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nativex.common.Response
public class Response
A simple response object to be used with ServerResponseHandler.
Nested Class Summary | |
---|---|
protected static class |
Response.TYPE
|
Field Summary | |
---|---|
private String |
response
|
private Response.TYPE |
responseType
|
private String |
status
|
private int |
statusCode
|
private String |
url
|
Constructor Summary | |
---|---|
Response()
Simple constructor. |
|
Response(int statusCode,
String status,
InputStream inputStream)
Constructor that receives the response parameters. |
Method Summary | |
---|---|
private String |
convertInputStreamToString(InputStream inputStream)
Converts the InputStream received from the server to String. |
String |
getPrettyResponse()
Prettifies the response body for debugging output. |
String |
getResponse()
Returns the response. |
protected Response.TYPE |
getResponseType()
Gets the response type. |
String |
getStatus()
Returns the response status. |
int |
getStatusCode()
Returns the HTTP connection status code. |
String |
getUrl()
Returns the request URL. |
protected void |
setRawResponse(String response)
Sets the value of the response field directly. |
void |
setResponse(InputStream inputStream)
Sets the response. |
protected void |
setResponseType(Response.TYPE type)
Sets the response type |
void |
setStatus(String status)
Sets the response status. |
void |
setStatusCode(int statusCode)
Sets the HTTP connection status code. |
void |
setUrl(String url)
Sets the request URL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int statusCode
private String response
private String url
private Response.TYPE responseType
private String status
Constructor Detail |
---|
public Response()
public Response(int statusCode, String status, InputStream inputStream)
statusCode
- R.integer
. The status code of the HTTP connection.status
- String
. A description of the Response status.inputStream
- InputStream
. The response from the server.Method Detail |
---|
public String getResponse()
String
. The response from the server.public String getPrettyResponse()
String
The response body, only prettier.private String convertInputStreamToString(InputStream inputStream)
String
. The response as String.public void setResponse(InputStream inputStream)
inputStream
- InputStream
. The response from the server to decode.protected void setRawResponse(String response)
inputStream
- String
. The response as String.public int getStatusCode()
R.integer
. The status code.public void setStatusCode(int statusCode)
statusCode
- R.integer
. The status code.public void setUrl(String url)
url
- String
. The URL of the request.public String getUrl()
String
. The request URL.protected void setResponseType(Response.TYPE type)
type
- Response.TYPE
. The respose type.protected Response.TYPE getResponseType()
Response.TYPE
. The response type.public String getStatus()
String
. The status.public void setStatus(String status)
status
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |