|
Spring Hateoas | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.hateoas.core.LinkBuilderSupport<T>
public abstract class LinkBuilderSupport<T extends LinkBuilder>
Base class to implement LinkBuilders based on a Spring MVC UriComponentsBuilder.
| Constructor Summary | |
|---|---|
LinkBuilderSupport(UriComponentsBuilder builder)
Creates a new LinkBuilderSupport using the given UriComponentsBuilder. |
|
| Method Summary | |
|---|---|
protected abstract T |
createNewInstance(UriComponentsBuilder builder)
Creates a new instance of the sub-class. |
protected abstract T |
getThis()
Returns the current concrete instance. |
T |
slash(Identifiable<?> identifyable)
Adds the given Identifiable's id as sub-resource. |
T |
slash(Object object)
Adds the given object's String representation as sub-resource to the current URI. |
String |
toString()
|
URI |
toUri()
Creates a URI of the link built by the current builder instance. |
Link |
withRel(String rel)
Creates the Link built by the current builder instance with the given rel. |
Link |
withSelfRel()
Creates the Link built by the current builder instance with the default self rel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LinkBuilderSupport(UriComponentsBuilder builder)
LinkBuilderSupport using the given UriComponentsBuilder.
builder - must not be null.| Method Detail |
|---|
public T slash(Object object)
LinkBuilderString representation as sub-resource to the current URI. Will unwrap
Identifiables to their id value (see Identifiable.getId()).
slash in interface LinkBuilderpublic T slash(Identifiable<?> identifyable)
LinkBuilderIdentifiable's id as sub-resource. Will simply return the LinkBuilder as is if the
given entity is null.
slash in interface LinkBuilderpublic URI toUri()
LinkBuilder
toUri in interface LinkBuilderpublic Link withRel(String rel)
LinkBuilderLink built by the current builder instance with the given rel.
withRel in interface LinkBuilderrel - must not be null or empty.
public Link withSelfRel()
LinkBuilderLink built by the current builder instance with the default self rel.
withSelfRel in interface LinkBuilderLink.REL_SELFpublic String toString()
toString in class Objectprotected abstract T getThis()
protected abstract T createNewInstance(UriComponentsBuilder builder)
builder - will never be null.
|
Spring Hateoas | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||