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 Link s. |
static <T> CollectionModel<T> |
of(Iterable<T> content,
Link... links)
Creates a
CollectionModel instance with the given content and Link s (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, removeLinks
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected CollectionModel()
CollectionModel
instance.@Deprecated public CollectionModel(Iterable<T> content, Link... links)
of(Iterable, Link...)
instead.CollectionModel
instance with the given content and Link
s (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 Link
s.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 Link
s (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 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.