|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsmartrics.rest.client.RestData
public abstract class RestData
Base class for holding shared data between RestRequest and RestResponse.
| Nested Class Summary | |
|---|---|
static class |
RestData.Header
Holds an Http Header. |
| Field Summary | |
|---|---|
static String |
LINE_SEPARATOR
|
| Constructor Summary | |
|---|---|
RestData()
|
|
| Method Summary | |
|---|---|
RestData |
addHeader(String name,
String value)
Adds an HTTP header to the current list. |
RestData |
addHeaders(List<RestData.Header> headers)
Adds a collection of HTTP headers to the current list of headers. |
RestData |
addHeaders(Map<String,String> headers)
Adds a collection of HTTP headers to the current list of headers. |
String |
getBody()
|
List<RestData.Header> |
getHeader(String name)
|
List<RestData.Header> |
getHeaders()
|
String |
getResource()
|
Long |
getTransactionId()
A transaction Id is a unique long for this transaction. |
RestData |
setBody(String body)
|
RestData |
setResource(String resource)
|
RestData |
setTransactionId(Long txId)
|
String |
toString()
A visually easy to read representation of this RestData. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String LINE_SEPARATOR
| Constructor Detail |
|---|
public RestData()
| Method Detail |
|---|
public String getBody()
public RestData setBody(String body)
body - the body
public String getResource()
/resource-type) for this
request/responsepublic RestData setResource(String resource)
resource - the resource type
public RestData setTransactionId(Long txId)
txId - the transaction id
public Long getTransactionId()
public List<RestData.Header> getHeaders()
public List<RestData.Header> getHeader(String name)
name - the header name
public RestData addHeader(String name,
String value)
name - the header namevalue - the header value
public RestData addHeaders(Map<String,String> headers)
headers - the collection of headers
public RestData addHeaders(List<RestData.Header> headers)
headers - the list of headers
public String toString()
RestData.
It tryes to match the typical Http Request/Response
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||