Class LinkBuilderSupport<T extends LinkBuilder>
java.lang.Object
org.springframework.hateoas.server.core.LinkBuilderSupport<T>
- All Implemented Interfaces:
LinkBuilder
- Direct Known Subclasses:
BasicLinkBuilder,TemplateVariableAwareLinkBuilderSupport
public abstract class LinkBuilderSupport<T extends LinkBuilder>
extends Object
implements LinkBuilder
Base class to implement
LinkBuilders based on a Spring MVC UriComponentsBuilder.- Author:
- Ricardo Gladwell, Oliver Gierke, Kamill Sokol, Kevin Conaway, Greg Turnquist
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLinkBuilderSupport(UriComponents builder) Creates a newLinkBuilderSupportusing the givenUriComponents.protectedLinkBuilderSupport(UriComponents components, List<Affordance> affordances) -
Method Summary
Modifier and TypeMethodDescriptionaddAffordances(Collection<Affordance> affordances) protected abstract TcreateNewInstance(UriComponents components, List<Affordance> affordances) Creates a new instance of the sub-class.protected abstract TgetThis()Returns the current concrete instance.Adds the given object'sStringrepresentation as sub-resource to the current URI.protected Tslash(UriComponents components, boolean encoded) toString()toUri()Creates a URI of the link built by the current builder instance.withRel(LinkRelation rel) Creates theLinkbuilt by the current builder instance with the givenLinkRelation.Creates theLinkbuilt by the current builder instance with the default self link relation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.hateoas.server.LinkBuilder
withRel
-
Constructor Details
-
LinkBuilderSupport
Creates a newLinkBuilderSupportusing the givenUriComponents.- Parameters:
builder- must not be null.
-
LinkBuilderSupport
-
-
Method Details
-
slash
Description copied from interface:LinkBuilderAdds the given object'sStringrepresentation as sub-resource to the current URI.- Specified by:
slashin interfaceLinkBuilder- Parameters:
object- can be null.- Returns:
-
slash
-
toUri
Description copied from interface:LinkBuilderCreates a URI of the link built by the current builder instance.- Specified by:
toUriin interfaceLinkBuilder- Returns:
-
addAffordances
-
withRel
Description copied from interface:LinkBuilderCreates theLinkbuilt by the current builder instance with the givenLinkRelation.- Specified by:
withRelin interfaceLinkBuilder- Parameters:
rel- must not be null or empty.- Returns:
-
withSelfRel
Description copied from interface:LinkBuilderCreates theLinkbuilt by the current builder instance with the default self link relation.- Specified by:
withSelfRelin interfaceLinkBuilder- Returns:
- See Also:
-
toString
-
getThis
Returns the current concrete instance.- Returns:
-
createNewInstance
Creates a new instance of the sub-class. -
getAffordances
-