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
Links.- Since:
- 1.0
- Author:
- Greg Turnquist, Oliver Drotbohm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classIntermediate representation of aLinkwithin a reactive pipeline to easily addAffordances from method invocations. -
Method Summary
Modifier and TypeMethodDescriptionprotected WebFluxLinkBuildercreateNewInstance(org.springframework.web.util.UriComponents components, List<Affordance> affordances, TemplateVariables variables) protected WebFluxLinkBuildergetThis()Returns the current concrete instance.Create aWebFluxLinkBuilderby checking if the Reactor Context contains aServerWebExchangeand using that combined with the Spring Web annotations to build a full URI.Create aWebFluxLinkBuilderusing an explicitly definedServerWebExchange.static <T> TWrapper 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, toStringMethods inherited from class org.springframework.hateoas.server.core.LinkBuilderSupport
addAffordances, getAffordances, slash, slash, toUri, withRel, withSelfRelMethods 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
-
Method Details
-
linkTo
Create aWebFluxLinkBuilderby checking if the Reactor Context contains aServerWebExchangeand 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, org.springframework.web.server.ServerWebExchange exchange) Create aWebFluxLinkBuilderusing 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(org.springframework.web.util.UriComponents components, List<Affordance> affordances, TemplateVariables variables) - Specified by:
createNewInstancein classTemplateVariableAwareLinkBuilderSupport<WebFluxLinkBuilder>
-
getThis
Description copied from class:LinkBuilderSupportReturns the current concrete instance.- Specified by:
getThisin classLinkBuilderSupport<WebFluxLinkBuilder>- Returns:
-