com.sugestio.client
Class SugestioResult<T>

java.lang.Object
  extended by com.sugestio.client.SugestioResult<T>

public class SugestioResult<T>
extends java.lang.Object


Constructor Summary
SugestioResult(boolean ok)
           
SugestioResult(javax.ws.rs.core.Response.StatusType statusType)
           
 
Method Summary
 T getEntity()
           
 java.lang.String getMessage()
          Contains the textual response from the server (if any), or a problem description in case of a local error.
 javax.ws.rs.core.Response.StatusType getStatusType()
          The response status received from the server.
 java.net.URI getUri()
           
 SugestioClient.Verb getVerb()
           
 boolean isOK()
          Indicates if the request was succesful.
 void printReport()
          Prints a full report of this service request.
 void printReport(java.io.PrintStream ps)
          Sends a full report of this service request to a PrintStream
 void setEntity(T entity)
           
 void setMessage(java.lang.String message)
           
 void setUri(java.net.URI uri)
           
 void setVerb(SugestioClient.Verb verb)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SugestioResult

public SugestioResult(javax.ws.rs.core.Response.StatusType statusType)

SugestioResult

public SugestioResult(boolean ok)
Method Detail

getStatusType

public javax.ws.rs.core.Response.StatusType getStatusType()
The response status received from the server. Returns null if the request never reached the server due to a client side problem, such as a network issue.

Returns:
status

isOK

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

Returns:
success

getMessage

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

Returns:
the message

setMessage

public void setMessage(java.lang.String message)
Parameters:
message - the message to set

getEntity

public T getEntity()
Returns:
the entity

setEntity

public void setEntity(T entity)
Parameters:
entity - the entity to set

getUri

public java.net.URI getUri()
Returns:
the URI

setUri

public void setUri(java.net.URI uri)
Parameters:
uri - the URI to set

getVerb

public SugestioClient.Verb getVerb()
Returns:
the verb

setVerb

public void setVerb(SugestioClient.Verb verb)
Parameters:
verb - the verb to set

printReport

public void printReport()
Prints a full report of this service request. If the request succeeded, the output goes to System.out. If there was a problem, the output goes to System.err.


printReport

public void printReport(java.io.PrintStream ps)
Sends a full report of this service request to a PrintStream

Parameters:
ps - the PrintStream