#1152 - Allow adding path segments to links created via WebFluxLinkBuilder.

WebFluxLinkBuilder now allows to call ….slash(…) in symmetry to other LinkBuilder implementations.
This commit is contained in:
Oliver Drotbohm
2019-12-09 12:07:41 +01:00
parent 8e96eafb37
commit 26c44dcc98
2 changed files with 28 additions and 1 deletions

View File

@@ -116,6 +116,20 @@ public class WebFluxLinkBuilder extends TemplateVariableAwareLinkBuilderSupport<
private final Mono<WebFluxLinkBuilder> builder;
/**
* Creates a new {@link WebFluxBuilder} appending the given path to the currently to be built link.
*
* @param path must not be {@literal null}.
* @return
* @since 1.1
*/
public WebFluxBuilder slash(String path) {
Assert.notNull(path, "Path must not be null!");
return new WebFluxBuilder(builder.map(it -> it.slash(path)));
}
/**
* Creates a new {@link WebFluxLink} for the {@link Link} with the given {@link LinkRelation}
*