@Immutable @ThreadSafe public class CamelJettyHttpResponse extends Object implements HttpResponse
HttpResponse to use with CamelJettyHttpSpy.
This implementation is immutable and contains immutable fields.
TODO test.
TODO Make character encoding configurable.
| Modifier | Constructor and Description |
|---|---|
protected |
CamelJettyHttpResponse(int statusCode,
String body,
Map<String,List<String>> headers,
long delayMillis)
Create new instance of response.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getBody()
Gets body.
|
long |
getDelayMillis()
Gets delay in milliseconds before sending the response.
|
Map<String,List<String>> |
getHeaders()
Gets headers.
|
int |
getStatusCode()
Gets status code.
|
String |
toString() |
protected CamelJettyHttpResponse(int statusCode,
String body,
Map<String,List<String>> headers,
long delayMillis)
statusCode - Response status code.body - Response body.headers - Response headers. If null, then headers will be set to
empty map.delayMillis - Delay in milliseconds before sending the response.NullPointerException - header name is null, list of header values
is null, a header value is null.IllegalArgumentException - header name is empty or blank, list of
header values is empty.IllegalArgumentException - delayMillis is negative.public int getStatusCode()
HttpResponsegetStatusCode in interface HttpResponsepublic String getBody()
HttpResponsegetBody in interface HttpResponsepublic Map<String,List<String>> getHeaders()
HttpResponsegetHeaders in interface HttpResponsepublic long getDelayMillis()
HttpResponsegetDelayMillis in interface HttpResponseCopyright © 2016. All rights reserved.