public abstract class LinkBuilderSupport<T extends LinkBuilder> extends Object implements LinkBuilder
LinkBuilders based on a Spring MVC UriComponentsBuilder.| Modifier | Constructor and Description |
|---|---|
protected |
LinkBuilderSupport(org.springframework.web.util.UriComponentsBuilder builder)
Creates a new
LinkBuilderSupport using the given UriComponents. |
protected |
LinkBuilderSupport(org.springframework.web.util.UriComponentsBuilder builder,
List<Affordance> affordances) |
protected |
LinkBuilderSupport(org.springframework.web.util.UriComponents components,
List<Affordance> affordances) |
| Modifier and Type | Method and Description |
|---|---|
T |
addAffordances(Collection<Affordance> affordances) |
protected abstract T |
createNewInstance(org.springframework.web.util.UriComponentsBuilder builder,
List<Affordance> affordances)
Creates a new instance of the sub-class.
|
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(org.springframework.web.util.UriComponents components,
boolean encoded) |
String |
toString() |
URI |
toUri()
Creates a URI of the link built by the current builder instance.
|
protected <S> S |
withFreshBuilder(Function<org.springframework.web.util.UriComponentsBuilder,S> function)
Executes the given
Function using a freshly cloned UriComponentsBuilder. |
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(org.springframework.web.util.UriComponentsBuilder builder)
LinkBuilderSupport using the given UriComponents.builder - must not be null.protected LinkBuilderSupport(org.springframework.web.util.UriComponentsBuilder builder,
List<Affordance> affordances)
protected LinkBuilderSupport(org.springframework.web.util.UriComponents components,
List<Affordance> affordances)
public T slash(Object object)
LinkBuilderString representation as sub-resource to the current URI.slash in interface LinkBuilderprotected T slash(org.springframework.web.util.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 <S> S withFreshBuilder(Function<org.springframework.web.util.UriComponentsBuilder,S> function)
Function using a freshly cloned UriComponentsBuilder.function - must not be null.protected abstract T getThis()
protected abstract T createNewInstance(org.springframework.web.util.UriComponentsBuilder builder, List<Affordance> affordances)
builder - will never be null.Copyright © 2012-2019–2019 Pivotal, Inc.. All rights reserved.