com.sugestio.client
Class SugestioResult

java.lang.Object
  extended by com.sugestio.client.SugestioResult

public class SugestioResult
extends java.lang.Object


Constructor Summary
SugestioResult()
          Creates a new instance of SugestioResult.
SugestioResult(boolean ok, int code, java.lang.String message)
          Creates a new instance of SugestioResult.
 
Method Summary
 int getCode()
          Gets the HTTP response code received from the server.
 java.lang.String getMessage()
          Gets the textual response from the server (if any), or a problem description in case of a local error.
 boolean isOk()
          Indicates if the request was successful.
 void setCode(int code)
          Set the HTTP response code.
 void setMessage(java.lang.String message)
          Set the textual response from the server.
 void setOk(boolean ok)
          Set the success indicator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SugestioResult

public SugestioResult()
Creates a new instance of SugestioResult.


SugestioResult

public SugestioResult(boolean ok,
                      int code,
                      java.lang.String message)
Creates a new instance of SugestioResult.

Parameters:
ok - request indicator
code - HTTP response code received from the server
message - textual response received from the server
Method Detail

setOk

public void setOk(boolean ok)
Set the success indicator.

Parameters:
ok -

isOk

public boolean isOk()
Indicates if the request was successful. Returns false if there was a server side or client side problem.

Returns:
success

setMessage

public void setMessage(java.lang.String message)
Set the textual response from the server.

Parameters:
message -

getMessage

public java.lang.String getMessage()
Gets the textual response from the server (if any), or a problem description in case of a local error.

Returns:
the message

setCode

public void setCode(int code)
Set the HTTP response code.

Parameters:
code -

getCode

public int getCode()
Gets the HTTP response code received from the server. Returns -1 if the request never reached the server due to a client side problem, such as a network issue.

Returns:
the code