public class EntityModel<T> extends RepresentationModel<EntityModel<T>>
EntityModel
wrapping a domain object and adding links to it.Modifier | Constructor and Description |
---|---|
protected |
EntityModel()
Creates an empty
EntityModel . |
|
EntityModel(T content,
Iterable<Link> links)
Creates a new
EntityModel with the given content and Link s. |
|
EntityModel(T content,
Link... links)
Creates a new
EntityModel with the given content and Link s (optional). |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
T |
getContent()
Returns the underlying entity.
|
int |
hashCode() |
String |
toString() |
add, add, add, getLink, getLink, getLinks, getLinks, getLinks, getRequiredLink, getRequiredLink, hasLink, hasLink, hasLinks, removeLinks
protected EntityModel()
EntityModel
.public EntityModel(T content, Link... links)
EntityModel
with the given content and Link
s (optional).content
- must not be null.links
- the links to add to the EntityModel
.public EntityModel(T content, Iterable<Link> links)
EntityModel
with the given content and Link
s.content
- must not be null.links
- the links to add to the EntityModel
.public T getContent()
public String toString()
toString
in class RepresentationModel<EntityModel<T>>
public boolean equals(Object obj)
equals
in class RepresentationModel<EntityModel<T>>
public int hashCode()
hashCode
in class RepresentationModel<EntityModel<T>>
Copyright © 2012-2019–2019 Pivotal, Inc.. All rights reserved.