| Modifier and Type | Class and Description |
|---|---|
static class |
Links.MergeMode
The mode how to merge two
Links instances. |
| Modifier and Type | Method and Description |
|---|---|
Links |
and(Iterable<Link> links)
|
Links |
and(Link... links)
|
static Collector<Link,?,Links> |
collector()
|
boolean |
contains(Iterable<Link> links)
|
boolean |
contains(Link... links)
|
boolean |
containsSameLinksAs(Iterable<Link> links)
|
boolean |
equals(Object arg0) |
Optional<Link> |
getLink(LinkRelation rel)
Returns the
Link with the given rel. |
Optional<Link> |
getLink(String relation)
Returns a
Link with the given relation if contained in the current Links instance,
Optional.empty() otherwise. |
Link |
getRequiredLink(LinkRelation relation)
Returns the
Link with the given relation. |
Link |
getRequiredLink(String rel)
Returns the
Link with the given relation. |
int |
hashCode() |
boolean |
hasLink(LinkRelation relation)
|
boolean |
hasLink(String relation)
|
boolean |
hasSingleLink()
|
boolean |
hasSize(long size)
Returns whether the current
Links has the given size. |
boolean |
isEmpty()
Returns whether the
Links container is empty. |
Iterator<Link> |
iterator() |
Links |
merge(Iterable<Link> links)
|
Links |
merge(Link... links)
|
Links |
merge(Links.MergeMode mode,
Iterable<Link> links)
Merges the current
Links with the given ones applying the given Links.MergeMode. |
Links |
merge(Links.MergeMode mode,
Link... links)
Merges the current
Links with the given ones applying the given Links.MergeMode. |
static Links |
of(Iterable<Link> links)
|
static Links |
of(Link... links)
|
static Links |
parse(String source)
Creates a
Links instance from the given RFC5988-compatible link format. |
Stream<Link> |
stream()
|
List<Link> |
toList()
|
String |
toString() |
static Links |
valueOf(String source)
Deprecated.
use
parse(String) instead |
Links |
without(LinkRelation relation)
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static final Links NONE
@Deprecated public static Links valueOf(String source)
parse(String) insteadLinks instance from the given RFC5988-compatible link format.public static Links parse(String source)
Links instance from the given RFC5988-compatible link format.public Links and(Link... links)
links - must not be null.merge(Link...),
merge(MergeMode, Link...)public Links and(Iterable<Link> links)
Links instance with all given Links added. For conditional adding see
merge(Iterable).links - must not be null.merge(Iterable),
merge(MergeMode, Iterable)public Links merge(Link... links)
Links with the given ones, skipping Links already contained in the current
instance. For unconditional combination see and(Link...).links - the Links to be merged, must not be null.Links.MergeMode.SKIP_BY_EQUALITY,
and(Link...)public Links merge(Iterable<Link> links)
Links with the given ones, skipping Links already contained in the current
instance. For unconditional combination see and(Link...).links - the Links to be merged, must not be null.Links.MergeMode.SKIP_BY_EQUALITY,
and(Link...)public Links merge(Links.MergeMode mode, Link... links)
Links with the given ones applying the given Links.MergeMode.mode - must not be null.links - must not be null.public Links merge(Links.MergeMode mode, Iterable<Link> links)
Links with the given ones applying the given Links.MergeMode.mode - must not be null.links - must not be null.public Links without(LinkRelation relation)
relation - must not be null.public Optional<Link> getLink(String relation)
Link with the given relation if contained in the current Links instance,
Optional.empty() otherwise.relation - must not be null or empty.public Optional<Link> getLink(LinkRelation rel)
Link with the given rel.rel - the relation type to lookup a link for.public Link getRequiredLink(String rel)
Link with the given relation.rel - the relation type to lookup a link for.IllegalArgumentException - if no link with the given relation was present.public Link getRequiredLink(LinkRelation relation)
Link with the given relation.relation - the relation type to lookup a link for.IllegalArgumentException - if no link with the given relation was present.public boolean hasLink(String relation)
relation - must not be null or empty.public boolean hasLink(LinkRelation relation)
relation - must not be null.public boolean isEmpty()
Links container is empty.public boolean hasSize(long size)
Links has the given size.size - public boolean hasSingleLink()
public boolean contains(Link... links)
links - must not be null.public boolean contains(Iterable<Link> links)
links - must not be null.public boolean containsSameLinksAs(Iterable<Link> links)
links - must not be null.Copyright © 2012-2019–2019 Pivotal, Inc.. All rights reserved.