Class WebFluxLinkBuilder
java.lang.Object
org.springframework.hateoas.server.core.LinkBuilderSupport<T>
org.springframework.hateoas.server.core.TemplateVariableAwareLinkBuilderSupport<WebFluxLinkBuilder>
org.springframework.hateoas.server.reactive.WebFluxLinkBuilder
- All Implemented Interfaces:
LinkBuilder
Utility for building reactive
Link
s.- Since:
- 1.0
- Author:
- Greg Turnquist, Oliver Drotbohm
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Intermediate representation of aLink
within a reactive pipeline to easily addAffordance
s from method invocations. -
Method Summary
Modifier and TypeMethodDescriptionprotected WebFluxLinkBuilder
createNewInstance
(UriComponents components, List<Affordance> affordances, TemplateVariables variables) protected WebFluxLinkBuilder
getThis()
Returns the current concrete instance.Create aWebFluxLinkBuilder
by checking if the Reactor Context contains aServerWebExchange
and using that combined with the Spring Web annotations to build a full URI.linkTo
(Object invocation, ServerWebExchange exchange) Create aWebFluxLinkBuilder
using an explicitly definedServerWebExchange
.static <T> T
Wrapper forDummyInvocationUtils.methodOn(Class, Object...)
to be available in case you work with static imports ofWebFluxLinkBuilder
.Methods inherited from class org.springframework.hateoas.server.core.TemplateVariableAwareLinkBuilderSupport
createNewInstance, toString
Methods inherited from class org.springframework.hateoas.server.core.LinkBuilderSupport
addAffordances, getAffordances, slash, slash, toUri, withRel, withSelfRel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.hateoas.server.LinkBuilder
withRel
-
Method Details
-
linkTo
Create aWebFluxLinkBuilder
by checking if the Reactor Context contains aServerWebExchange
and using that combined with the Spring Web annotations to build a full URI. If there is no exchange, then fall back to relative URIs. Usually used withmethodOn(Class, Object...)
to refer to a method invocation.- Parameters:
invocation
- must not be null.- See Also:
-
linkTo
public static WebFluxLinkBuilder.WebFluxBuilder linkTo(Object invocation, ServerWebExchange exchange) Create aWebFluxLinkBuilder
using an explicitly definedServerWebExchange
. This is possible if your WebFlux method includes the exchange and you want to pass it straight in.- Parameters:
invocation
- must not be null.exchange
- must not be null.
-
methodOn
Wrapper forDummyInvocationUtils.methodOn(Class, Object...)
to be available in case you work with static imports ofWebFluxLinkBuilder
.- Parameters:
controller
- must not be null.parameters
- parameters to extend template variables in the type level mapping.- Returns:
-
createNewInstance
protected WebFluxLinkBuilder createNewInstance(UriComponents components, List<Affordance> affordances, TemplateVariables variables) - Specified by:
createNewInstance
in classTemplateVariableAwareLinkBuilderSupport<WebFluxLinkBuilder>
-
getThis
Description copied from class:LinkBuilderSupport
Returns the current concrete instance.- Specified by:
getThis
in classLinkBuilderSupport<WebFluxLinkBuilder>
- Returns:
-