public abstract class LinkBuilderSupport<T extends LinkBuilder> extends Object implements LinkBuilder
LinkBuilders based on a Spring MVC UriComponentsBuilder.| Modifier | Constructor and Description |
|---|---|
protected |
LinkBuilderSupport(UriComponents builder)
Creates a new
LinkBuilderSupport using the given UriComponents. |
protected |
LinkBuilderSupport(UriComponents components,
List<Affordance> affordances) |
| Modifier and Type | Method and Description |
|---|---|
T |
addAffordances(Collection<Affordance> affordances) |
protected abstract T |
createNewInstance(UriComponents components,
List<Affordance> affordances)
Creates a new instance of the sub-class.
|
List<Affordance> |
getAffordances() |
protected abstract T |
getThis()
Returns the current concrete instance.
|
T |
slash(Object object)
Adds the given object's
String representation as sub-resource to the current URI. |
protected T |
slash(UriComponents components,
boolean encoded) |
String |
toString() |
URI |
toUri()
Creates a URI of the link built by the current builder instance.
|
Link |
withRel(LinkRelation rel)
Creates the
Link built by the current builder instance with the given LinkRelation. |
Link |
withSelfRel()
Creates the
Link built by the current builder instance with the default self link relation. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitwithRelprotected LinkBuilderSupport(UriComponents builder)
LinkBuilderSupport using the given UriComponents.builder - must not be null.protected LinkBuilderSupport(UriComponents components, List<Affordance> affordances)
public T slash(@Nullable Object object)
LinkBuilderString representation as sub-resource to the current URI.slash in interface LinkBuilderobject - can be null.protected T slash(UriComponents components, boolean encoded)
public URI toUri()
LinkBuildertoUri in interface LinkBuilderpublic T addAffordances(Collection<Affordance> affordances)
public Link withRel(LinkRelation rel)
LinkBuilderLink built by the current builder instance with the given LinkRelation.withRel in interface LinkBuilderrel - must not be null or empty.public Link withSelfRel()
LinkBuilderLink built by the current builder instance with the default self link relation.withSelfRel in interface LinkBuilderIanaLinkRelations.SELFprotected abstract T getThis()
protected abstract T createNewInstance(UriComponents components, List<Affordance> affordances)
public List<Affordance> getAffordances()
Copyright © 2011–2023 Pivotal, Inc.. All rights reserved.