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)
Deprecated.
since 1.1, use
of(Iterable, Iterable) instead. |
|
CollectionModel(Iterable<T> content,
Link... links)
Deprecated.
since 1.1, use
of(Iterable, Link...) instead. |
| Modifier and Type | Method and Description |
|---|---|
static <T> CollectionModel<T> |
empty()
Creates a new empty collection model.
|
static <T> CollectionModel<T> |
empty(Iterable<Link> links)
Creates a new empty collection model with the given links.
|
static <T> CollectionModel<T> |
empty(Link... links)
Creates a new empty collection model with the given links.
|
boolean |
equals(Object obj) |
Collection<T> |
getContent()
Returns the underlying elements.
|
int |
hashCode() |
Iterator<T> |
iterator() |
static <T> CollectionModel<T> |
of(Iterable<T> content)
Creates a
CollectionModel instance with the given content. |
static <T> CollectionModel<T> |
of(Iterable<T> content,
Iterable<Link> links)
s Creates a
CollectionModel instance with the given content and Links. |
static <T> CollectionModel<T> |
of(Iterable<T> content,
Link... links)
Creates a
CollectionModel instance with the given content and Links (optional). |
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, removeLinksclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected CollectionModel()
CollectionModel instance.@Deprecated public CollectionModel(Iterable<T> content, Link... links)
of(Iterable, Link...) instead.CollectionModel instance with the given content and Links (optional).content - must not be null.links - the links to be added to the CollectionModel.@Deprecated public CollectionModel(Iterable<T> content, Iterable<Link> links)
of(Iterable, Iterable) instead.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> CollectionModel<T> empty()
T - public static <T> CollectionModel<T> empty(Link... links)
T - links - must not be null.public static <T> CollectionModel<T> empty(Iterable<Link> links)
T - links - must not be null.public static <T> CollectionModel<T> of(Iterable<T> content)
CollectionModel instance with the given content.content - must not be null.public static <T> CollectionModel<T> of(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 static <T> CollectionModel<T> of(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 © 2011–2021 VMware, Inc.. All rights reserved.