Class ParametersModifyingOperationPreprocessor
java.lang.Object
org.springframework.restdocs.operation.preprocess.OperationPreprocessorAdapter
org.springframework.restdocs.operation.preprocess.ParametersModifyingOperationPreprocessor
- All Implemented Interfaces:
OperationPreprocessor
An
OperationPreprocessor that can be used to modify a request's
OperationRequest.getParameters() by adding, setting, and removing parameters.- Since:
- 1.1.0
- Author:
- Andy Wilkinson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a parameter with the givennameandvalue.preprocess(OperationRequest request) Returns the givenrequestas-is.Removes the parameter with the givenname.Removes the givenvaluefrom the parameter with the givenname.Sets the parameter with the givennameto have the givenvalues.Methods inherited from class org.springframework.restdocs.operation.preprocess.OperationPreprocessorAdapter
preprocess
-
Constructor Details
-
ParametersModifyingOperationPreprocessor
public ParametersModifyingOperationPreprocessor()
-
-
Method Details
-
preprocess
Description copied from class:OperationPreprocessorAdapterReturns the givenrequestas-is.- Specified by:
preprocessin interfaceOperationPreprocessor- Overrides:
preprocessin classOperationPreprocessorAdapter- Parameters:
request- the request- Returns:
- the unmodified request
-
add
Adds a parameter with the givennameandvalue.- Parameters:
name- the namevalue- the value- Returns:
this
-
set
Sets the parameter with the givennameto have the givenvalues.- Parameters:
name- the namevalues- the values- Returns:
this
-
remove
Removes the parameter with the givenname.- Parameters:
name- the name of the parameter- Returns:
this
-
remove
Removes the givenvaluefrom the parameter with the givenname.- Parameters:
name- the namevalue- the value- Returns:
this
-