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(UriComponentsBuilder builder,
List<Affordance> affordances)
Deprecated.
since 1.0.3, for removal in 1.1. Use
LinkBuilderSupport(UriComponents, List)
instead. |
protected |
LinkBuilderSupport(UriComponents components,
List<Affordance> affordances)
|
| Modifier and Type | Method and Description |
|---|---|
T |
addAffordances(Collection<Affordance> affordances) |
protected T |
createNewInstance(UriComponentsBuilder builder,
List<Affordance> affordances)
Deprecated.
since 1.0.3, for removal in 1.1. override
createNewInstance(UriComponents, List) instead |
protected T |
createNewInstance(UriComponents components,
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(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.@Deprecated protected LinkBuilderSupport(UriComponentsBuilder builder, List<Affordance> affordances)
LinkBuilderSupport(UriComponents, List)
instead.builder - must not be null.affordances - must not be null.protected LinkBuilderSupport(UriComponents components, List<Affordance> affordances)
components - must not be null.affordances - must not be null.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.SELF@Deprecated protected T createNewInstance(UriComponentsBuilder builder, List<Affordance> affordances)
createNewInstance(UriComponents, List) insteadLinkBuilder.builder - must not be null.affordances - must not be null.protected abstract T getThis()
protected T createNewInstance(UriComponents components, List<Affordance> affordances)
builder - will never be null.Copyright © 2011–2020 Pivotal, Inc.. All rights reserved.