public class OperationResponseFactory extends Object
OperationResponses
.Constructor and Description |
---|
OperationResponseFactory() |
Modifier and Type | Method and Description |
---|---|
OperationResponse |
create(HttpStatus status,
HttpHeaders headers,
byte[] content)
Creates a new
OperationResponse . |
OperationResponse |
createFrom(OperationResponse original,
byte[] newContent)
Creates a new
OperationResponse based on the given original but
with the given newContent . |
OperationResponse |
createFrom(OperationResponse original,
HttpHeaders newHeaders)
Creates a new
OperationResponse based on the given original but
with the given newHeaders . |
public OperationResponse create(HttpStatus status, HttpHeaders headers, byte[] content)
OperationResponse
. If the response has any content, the given
headers
will be augmented to ensure that they include a
Content-Length
header.status
- the status of the responseheaders
- the request's headerscontent
- the content of the requestOperationResponse
public OperationResponse createFrom(OperationResponse original, byte[] newContent)
OperationResponse
based on the given original
but
with the given newContent
. If the original response had a
Content-Length
header it will be modified to match the length of the new
content.original
- The original responsenewContent
- The new contentpublic OperationResponse createFrom(OperationResponse original, HttpHeaders newHeaders)
OperationResponse
based on the given original
but
with the given newHeaders
.original
- The original responsenewHeaders
- The new headers