Skip to content

Commit 2055466

Browse files
fhanikjzheaux
authored andcommitted
Add Javadoc
1 parent ddf6882 commit 2055466

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

web/src/main/java/org/springframework/security/web/util/matcher/RequestMatcher.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,23 @@ public interface RequestMatcher {
3838
boolean matches(HttpServletRequest request);
3939

4040
/**
41-
* @since 5.2
41+
* Returns a MatchResult for this RequestMatcher
42+
* The default implementation returns {@link Collections#emptyMap()}
43+
* when {@link MatchResult#getVariables()} is invoked.
44+
*
45+
* @return the MatchResult from comparing this RequestMatcher against the HttpServletRequest
46+
* @since 5.2
4247
*/
4348
default MatchResult matcher(HttpServletRequest request) {
4449
boolean match = matches(request);
4550
return new MatchResult(match, Collections.emptyMap());
4651
}
4752

4853
/**
49-
* The result of matching
54+
* The result of matching against an HttpServletRequest
55+
* Contains the status, true or false, of the match and
56+
* if present, any variables extracted from the match
57+
* @since 5.2
5058
*/
5159
class MatchResult {
5260
private final boolean match;
@@ -57,10 +65,18 @@ class MatchResult {
5765
this.variables = variables;
5866
}
5967

68+
/**
69+
* @return true if the comparison against the HttpServletRequest produced a successful match
70+
*/
6071
public boolean isMatch() {
6172
return this.match;
6273
}
6374

75+
/**
76+
* Returns the extracted variable values where the key is the variable name and the value is the variable value
77+
*
78+
* @return a map containing key-value pairs representing extracted variable names and variable values
79+
*/
6480
public Map<String, String> getVariables() {
6581
return this.variables;
6682
}

0 commit comments

Comments
 (0)