public interface HalResponseBuilder
extends net.eusashead.hateoas.response.ResponseBuilder<com.theoryinpractise.halbuilder.api.Representation>
ResponseEntity
should have status code 200 and
should have a body of type Representation,
or a null body for a HEAD. It should have
ETags, Last-Modified, Expires and
Cache-Control headers.| Modifier and Type | Method and Description |
|---|---|
HalResponseBuilder |
convert(Object bean)
Set the underlying
Representation
by converting the supplied Object
into a Representation using the
default conversion mechanism. |
<T> HalResponseBuilder |
convert(T bean,
RepresentationWriter<T> writer)
Set the underlying
Representation
by converting the supplied Object
into a Representation using the
supplied RepresentationWriter
in favour of the default conversion mechanism. |
HalResponseBuilder |
etag()
Create ETag header based
on the best available
ETagStrategy |
HalResponseBuilder |
etag(Date date)
Create a weak ETag based
on the supplied date
|
HalResponseBuilder |
etag(net.eusashead.hateoas.header.ETagHeaderStrategy strategy)
Create ETag header based
on the supplied
ETagStrategy |
HalResponseBuilder |
etag(Integer version)
Create a strong ETag based
on the supplied version
number
|
HalResponseBuilder |
etag(Long version)
Create a strong ETag based
on the supplied version
number
|
HalResponseBuilder |
expireIn(long millis)
Set the the Expires and
Cache-Control headers
based on the supplied
number of milliseconds
|
HalResponseBuilder |
lastModified(Date date)
Set the Last-Modified header
based on the supplied date
|
HalResponseBuilder |
representation(com.theoryinpractise.halbuilder.api.Representation representation)
Set the HAL
Representation
that this response represents |
HalResponseBuilder |
withBean(Object value)
Copy the fields from the supplied
Java Bean as properties of the
wrapped
Representation (entity) |
HalResponseBuilder |
withBeanBasedRepresentation(String rel,
String href,
Object o)
Add the supplied bean as
an embedded
Representation
within the wrapped Representation
with the specified rel and href. |
HalResponseBuilder |
withLink(String rel,
String href)
Add a link to the
wrapped
Representation |
HalResponseBuilder |
withNamespace(String namespace,
String href)
Add a namespace to the
wrapped
Representation |
HalResponseBuilder |
withProperty(String name,
Object value)
Add the supplied property
to the wrapped
Representation |
HalResponseBuilder |
withRepresentation(String rel,
com.theoryinpractise.halbuilder.api.ReadableRepresentation resource)
Add the supplied
Representation
to the wrapped Representation
as an embedded resource. |
HalResponseBuilder withProperty(String name, Object value)
Representationname - value - HalResponseBuilderHalResponseBuilder withRepresentation(String rel, com.theoryinpractise.halbuilder.api.ReadableRepresentation resource)
Representation
to the wrapped Representation
as an embedded resource.rel - resource - HalResponseBuilderHalResponseBuilder withLink(String rel, String href)
Representationrel - href - HalResponseBuilderHalResponseBuilder withNamespace(String namespace, String href)
Representationnamespace - href - HalResponseBuilderHalResponseBuilder withBean(Object value)
Representation (entity)value - HalResponseBuilderHalResponseBuilder withBeanBasedRepresentation(String rel, String href, Object o)
Representation
within the wrapped Representation
with the specified rel and href.rel - the name of the embedded representationhref - the URI of the representationo - the Java Bean object to create the representation fromHalResponseBuilderHalResponseBuilder representation(com.theoryinpractise.halbuilder.api.Representation representation)
Representation
that this response representsthe - Representation to setHalResponseBuilderHalResponseBuilder convert(Object bean)
Representation
by converting the supplied Object
into a Representation using the
default conversion mechanism.bean - the Object to convertHalResponseBuilder<T> HalResponseBuilder convert(T bean, RepresentationWriter<T> writer)
Representation
by converting the supplied Object
into a Representation using the
supplied RepresentationWriter
in favour of the default conversion mechanism.bean - the Object to convertwriter - the RepresentationWriter to perform the conversionHalResponseBuilderHalResponseBuilder etag()
ETagStrategyHalResponseBuilderHalResponseBuilder etag(net.eusashead.hateoas.header.ETagHeaderStrategy strategy)
ETagStrategyHalResponseBuilderHalResponseBuilder etag(Date date)
date - Date of last modificationHalResponseBuilderHalResponseBuilder etag(Integer version)
version - Integer version numberHalResponseBuilderHalResponseBuilder etag(Long version)
version - Long version numberHalResponseBuilderHalResponseBuilder lastModified(Date date)
date - Date of last modificationHalResponseBuilderHalResponseBuilder expireIn(long millis)
millis - HalResponseBuilderCopyright © 2013. All Rights Reserved.