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 Link s. |
|
CollectionModel(Iterable<T> content,
Link... links)
Creates a
CollectionModel instance with the given content and Link s (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, addAllIf, addIf, getLink, getLink, getLinks, getLinks, getLinks, getRequiredLink, getRequiredLink, hasLink, hasLink, hasLinks, removeLinks
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected CollectionModel()
CollectionModel
instance.public CollectionModel(Iterable<T> content, Link... links)
CollectionModel
instance with the given content and Link
s (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 Link
s.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 © 2011–2020 Pivotal, Inc.. All rights reserved.