Fix delegation in ServerRequest decorators
Closes gh-31955
This commit is contained in:
@@ -1090,6 +1090,12 @@ public abstract class RequestPredicates {
|
||||
return this.delegate.path();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public PathContainer pathContainer() {
|
||||
return this.delegate.pathContainer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequestPath requestPath() {
|
||||
return this.delegate.requestPath();
|
||||
@@ -1135,11 +1141,21 @@ public abstract class RequestPredicates {
|
||||
return this.delegate.bind(bindType, dataBinderCustomizer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Object> attribute(String name) {
|
||||
return this.delegate.attribute(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> attributes() {
|
||||
return this.delegate.attributes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<String> param(String name) {
|
||||
return this.delegate.param(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiValueMap<String, String> params() {
|
||||
return this.delegate.params();
|
||||
@@ -1150,6 +1166,11 @@ public abstract class RequestPredicates {
|
||||
return this.delegate.multipartData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String pathVariable(String name) {
|
||||
return this.delegate.pathVariable(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> pathVariables() {
|
||||
return this.delegate.pathVariables();
|
||||
@@ -1203,12 +1224,27 @@ public abstract class RequestPredicates {
|
||||
this.attributes = mergeMaps(delegate.attributes(), newAttributes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Object> attribute(String name) {
|
||||
return Optional.ofNullable(this.attributes.get(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> attributes() {
|
||||
return this.attributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String pathVariable(String name) {
|
||||
Map<String, String> pathVariables = pathVariables();
|
||||
if (pathVariables.containsKey(name)) {
|
||||
return pathVariables().get(name);
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("No path variable with name \"" + name + "\" available");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, String> pathVariables() {
|
||||
@@ -1258,5 +1294,16 @@ public abstract class RequestPredicates {
|
||||
public RequestPath requestPath() {
|
||||
return this.requestPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String path() {
|
||||
return this.requestPath.pathWithinApplication().value();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public PathContainer pathContainer() {
|
||||
return this.requestPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user