public interface ResponseBuilder
extends net.eusashead.parquet.entity.MutableEntity
| Modifier and Type | Method and Description |
|---|---|
ResponseBuilder |
body(net.eusashead.parquet.entity.Entity entity)
Set the body to the
supplied
Entity |
<T> ResponseBuilder |
body(T target,
net.eusashead.parquet.entity.EntityConverter<T> converter) |
Response |
build()
Return the built
Response |
void |
checkPrecondition(net.eusashead.parquet.util.Option<ETag> eTag,
net.eusashead.parquet.util.Option<HttpDate> lastModified,
PreconditionSuccessHandler handler)
Check precondition before
executing the
PreconditionSuccessHandler
Check value of If-Match, If-Unmodified-Since
If-None-Match and If-Modified-Since and return
either 412 or 304 (for GET or HEAD only)
if the precondition fails. |
ResponseBuilder |
embed(java.lang.String rel,
net.eusashead.parquet.entity.Entity entity) |
<T> ResponseBuilder |
embed(java.lang.String rel,
T target,
net.eusashead.parquet.entity.EntityConverter<T> converter) |
net.eusashead.parquet.entity.EntityFactory |
entityFactory()
Get the
EntityFactory
used to build the body
of this response |
<T> ResponseBuilder |
forEach(java.lang.String rel,
java.lang.Iterable<T> target,
net.eusashead.parquet.entity.EntityConverter<T> converter) |
ResponseBuilder |
link(net.eusashead.parquet.entity.Link link) |
ResponseBuilder |
property(java.lang.String name,
java.lang.Object value) |
ResponseBuilder |
property(java.lang.String name,
java.lang.Object value,
net.eusashead.parquet.entity.PropertyConverter<?,java.lang.Object> converter) |
Request |
request()
Get the underlying
Request |
void |
requirePrecondition(net.eusashead.parquet.util.Option<ETag> eTag,
net.eusashead.parquet.util.Option<HttpDate> lastModified,
PreconditionSuccessHandler handler)
Require a precondition check before
executing the
PreconditionSuccessHandler
returning an error if the check fails
or if the precondition headers are absent
Check value of If-Match, If-Unmodified-Since
If-None-Match and If-Modified-Since and return
either 412 or 304 (for GET or HEAD only)
if the precondition fails. |
void |
send()
Send the response
|
ResponseBuilder |
status(HttpStatus status)
HTTP status code to send
|
ResponseBuilder status(HttpStatus status)
status - HttpStatus to useResponseBuildervoid send()
net.eusashead.parquet.entity.EntityFactory entityFactory()
EntityFactory
used to build the body
of this responseEntityFactory for this ResponseBuilderResponseBuilder body(net.eusashead.parquet.entity.Entity entity)
Entityentity - ResponseBuilder<T> ResponseBuilder body(T target, net.eusashead.parquet.entity.EntityConverter<T> converter)
target - converter - void checkPrecondition(net.eusashead.parquet.util.Option<ETag> eTag, net.eusashead.parquet.util.Option<HttpDate> lastModified, PreconditionSuccessHandler handler)
PreconditionSuccessHandler
Check value of If-Match, If-Unmodified-Since
If-None-Match and If-Modified-Since and return
either 412 or 304 (for GET or HEAD only)
if the precondition fails.eTag - ETag value for current resourcelastModified - Last-Modified date for current resourcehandler - PreconditionSuccessHandler action to execute if precondition succeedsvoid requirePrecondition(net.eusashead.parquet.util.Option<ETag> eTag, net.eusashead.parquet.util.Option<HttpDate> lastModified, PreconditionSuccessHandler handler)
PreconditionSuccessHandler
returning an error if the check fails
or if the precondition headers are absent
Check value of If-Match, If-Unmodified-Since
If-None-Match and If-Modified-Since and return
either 412 or 304 (for GET or HEAD only)
if the precondition fails.
If none of the headers above are supplied
return a 428 error.eTag - ETag value for current resourcelastModified - Last-Modified date for current resourcehandler - PreconditionSuccessHandler action to execute if precondition succeedsResponseBuilder property(java.lang.String name, java.lang.Object value)
property in interface net.eusashead.parquet.entity.MutableEntityResponseBuilder property(java.lang.String name, java.lang.Object value, net.eusashead.parquet.entity.PropertyConverter<?,java.lang.Object> converter)
property in interface net.eusashead.parquet.entity.MutableEntityResponseBuilder embed(java.lang.String rel, net.eusashead.parquet.entity.Entity entity)
embed in interface net.eusashead.parquet.entity.MutableEntity<T> ResponseBuilder embed(java.lang.String rel, T target, net.eusashead.parquet.entity.EntityConverter<T> converter)
embed in interface net.eusashead.parquet.entity.MutableEntity<T> ResponseBuilder forEach(java.lang.String rel, java.lang.Iterable<T> target, net.eusashead.parquet.entity.EntityConverter<T> converter)
forEach in interface net.eusashead.parquet.entity.MutableEntityResponseBuilder link(net.eusashead.parquet.entity.Link link)
link in interface net.eusashead.parquet.entity.MutableEntity