public class ParameterRequestMatcher extends RequestMatcher<List<String>>
RequestMatcher
used for matching a request parameter.pred
Constructor and Description |
---|
ParameterRequestMatcher(org.hamcrest.Matcher<? super List<String>> pred,
String paramName)
Protected constructor useful only when subtyping.
|
Modifier and Type | Method and Description |
---|---|
protected String |
provideDescription()
Provides a description of this matcher in form of a string consisting of "noun verb", where
noun describes the value retrieved using
RequestMatcher.retrieveValue(net.jadler.Request) and verb is usually a correct
form of to be. |
static ParameterRequestMatcher |
requestParameter(String paramName,
org.hamcrest.Matcher<? super List<String>> pred)
Factory method to create new instance of this matcher.
|
protected List<String> |
retrieveValue(Request req)
Retrieves a parameter (defined in
ParameterRequestMatcher(org.hamcrest.Matcher, java.lang.String) )
of the given request. |
describeMismatch, describeTo, matches
public ParameterRequestMatcher(org.hamcrest.Matcher<? super List<String>> pred, String paramName)
requestParameter(java.lang.String, org.hamcrest.Matcher)
instead.pred
- a predicate to be applied on the given request parameterparamName
- name of a request parameter (case sensitive)protected List<String> retrieveValue(Request req)
ParameterRequestMatcher(org.hamcrest.Matcher, java.lang.String)
)
of the given request. The values are percent-encoded.retrieveValue
in class RequestMatcher<List<String>>
req
- request to retrieve the parameter fromnull
if there is no such a parameter in the requestprotected String provideDescription()
Provides a description of this matcher in form of a string consisting of "noun verb", where
noun describes the value retrieved using RequestMatcher.retrieveValue(net.jadler.Request)
and verb is usually a correct
form of to be.
If the RequestMatcher.retrieveValue(net.jadler.Request)
provided a request method, this method would return
method is string for example.
provideDescription
in class RequestMatcher<List<String>>
public static ParameterRequestMatcher requestParameter(String paramName, org.hamcrest.Matcher<? super List<String>> pred)
paramName
- name of a request parameterpred
- a predicate to be applied on the request parameterCopyright © 2016. All Rights Reserved.