public class CollectionModel<T> extends RepresentationModel<CollectionModel<T>> implements Iterable<T>
| Modifier | Constructor and Description |
|---|---|
protected |
CollectionModel()
Creates an empty
CollectionModel instance. |
|
CollectionModel(Iterable<T> content,
Iterable<Link> links)
Creates a
CollectionModel instance with the given content and Links. |
|
CollectionModel(Iterable<T> content,
Link... links)
Creates a
CollectionModel instance with the given content and Links (optional). |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Collection<T> |
getContent()
Returns the underlying elements.
|
int |
hashCode() |
Iterator<T> |
iterator() |
String |
toString() |
static <T extends EntityModel<S>,S> |
wrap(Iterable<S> content)
Creates a new
CollectionModel instance by wrapping the given domain class instances into a
EntityModel. |
add, add, add, getLink, getLink, getLinks, getLinks, getLinks, getRequiredLink, getRequiredLink, hasLink, hasLink, hasLinks, removeLinksclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected CollectionModel()
CollectionModel instance.public CollectionModel(Iterable<T> content, Link... links)
CollectionModel instance with the given content and Links (optional).content - must not be null.links - the links to be added to the CollectionModel.public CollectionModel(Iterable<T> content, Iterable<Link> links)
CollectionModel instance with the given content and Links.content - must not be null.links - the links to be added to the CollectionModel.public static <T extends EntityModel<S>,S> CollectionModel<T> wrap(Iterable<S> content)
CollectionModel instance by wrapping the given domain class instances into a
EntityModel.content - must not be null.public Collection<T> getContent()
public String toString()
toString in class RepresentationModel<CollectionModel<T>>public boolean equals(@Nullable Object obj)
equals in class RepresentationModel<CollectionModel<T>>public int hashCode()
hashCode in class RepresentationModel<CollectionModel<T>>Copyright © 2012-2019–2019 Pivotal, Inc.. All rights reserved.