public class HalFormsDocument<T> extends Object
| Modifier and Type | Method and Description |
|---|---|
HalFormsDocument<T> |
andEmbedded(HalLinkRelation key,
Object value)
Adds the given value as embedded one.
|
HalFormsDocument<T> |
andLink(Link link)
Adds the given
Link to the current document. |
HalFormsDocument<T> |
andTemplate(String name,
HalFormsTemplate template)
Adds the given
HalFormsTemplate to the current document. |
static HalFormsDocument<?> |
empty()
Creates a new empty
HalFormsDocument. |
static <T> HalFormsDocument<T> |
forEntities(Collection<T> entities)
returns a new
HalFormsDocument for the given resources. |
static <T> HalFormsDocument<T> |
forEntity(T resource)
Creates a new
HalFormsDocument for the given resource. |
static HalFormsDocument<?> |
forRepresentationModel(RepresentationModel<?> model)
Creates a new
HalFormsDocument for the given resource support. |
HalFormsTemplate |
getDefaultTemplate()
Returns the default template of the document.
|
HalFormsTemplate |
getTemplate(String key)
Returns the template with the given name.
|
HalFormsDocument<T> |
withPageMetadata(PagedModel.PageMetadata metadata) |
public static HalFormsDocument<?> forRepresentationModel(RepresentationModel<?> model)
HalFormsDocument for the given resource support.model - can be nullpublic static <T> HalFormsDocument<T> forEntity(@Nullable T resource)
HalFormsDocument for the given resource.resource - can be null.public static <T> HalFormsDocument<T> forEntities(Collection<T> entities)
HalFormsDocument for the given resources.entities - must not be null.public static HalFormsDocument<?> empty()
HalFormsDocument.public HalFormsTemplate getDefaultTemplate()
public HalFormsTemplate getTemplate(String key)
key - must not be null.public HalFormsDocument<T> withPageMetadata(@Nullable PagedModel.PageMetadata metadata)
public HalFormsDocument<T> andLink(Link link)
Link to the current document.link - must not be null.public HalFormsDocument<T> andTemplate(String name, HalFormsTemplate template)
HalFormsTemplate to the current document.name - must not be null or empty.template - must not be null.public HalFormsDocument<T> andEmbedded(HalLinkRelation key, Object value)
key - must not be null or empty.value - must not be null.Copyright © 2011–2020 Pivotal, Inc.. All rights reserved.