| 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)
|
Links |
and(Stream<Link> links)
|
Links |
andIf(boolean condition,
Link... links)
Adds the given links if the given condition is true.
|
Links |
andIf(boolean condition,
Stream<Link> links)
Adds the given links if the given condition is true.
|
Links |
andIf(boolean condition,
Supplier<Link>... links)
Adds the given links if the given condition is true.
|
static Collector<Link,?,Links> |
collector()
|
boolean |
contains(Iterable<Link> links)
|
boolean |
contains(Link... links)
|
boolean |
containsSameLinksAs(Iterable<Link> links)
|
boolean |
equals(Object obj) |
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. |
Links |
merge(Links.MergeMode mode,
Stream<Link> links)
Merges the current
Links with the given ones applying the given Links.MergeMode. |
Links |
merge(Stream<Link> links)
|
static Links |
of(Iterable<Link> links)
|
static Links |
of(Link... links)
|
static Links |
parse(String source)
Creates a
Links instance from the given RFC-8288-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 RFC-8288-compatible link format.public static Links parse(@Nullable String source)
Links instance from the given RFC-8288-compatible link format.public Links and(Link... links)
links - must not be null.merge(Link...),
merge(MergeMode, Link...)@SafeVarargs public final Links andIf(boolean condition, Link... links)
Links will only be resolved if
the given condition is true. Essentially syntactic sugar to write:
if (a > 3) {
links = links.and(…);
}
as
links = link.andIf(a > 3, …);
condition - links - must not be null.@SafeVarargs public final Links andIf(boolean condition, Supplier<Link>... links)
Suppliers will only be resolved
if the given condition is true. Essentially syntactic sugar to write:
if (a > 3) {
links = links.and(…);
}
as
links = link.andIf(a > 3, …);
condition - links - must not be null.public final Links andIf(boolean condition, Stream<Link> links)
Stream will only be resolved if
the given condition is true. Essentially syntactic sugar to write:
if (a > 3) {
links = links.and(…);
}
as
links = link.andIf(a > 3, …);
condition - links - must not be null.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 and(Stream<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(Stream<Link> links)
Links with the given ones, skipping Links already contained in the current
instance. For unconditional combination see and(Stream).links - the Links to be merged, must not be null.Links.MergeMode.SKIP_BY_EQUALITY,
and(Stream)public Links merge(Iterable<Link> links)
Links with the given ones, skipping Links already contained in the current
instance. For unconditional combination see and(Iterable).links - the Links to be merged, must not be null.Links.MergeMode.SKIP_BY_EQUALITY,
and(Iterable)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, Stream<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 © 2011–2021 Pivotal, Inc.. All rights reserved.