Package org.apache.wicket.mock
Class MockRequestParameters
- java.lang.Object
-
- org.apache.wicket.mock.MockRequestParameters
-
- All Implemented Interfaces:
IRequestParameters
,IWritableRequestParameters
public class MockRequestParameters extends Object implements IWritableRequestParameters
Mutable mock implementation ofIRequestParameters
.- Author:
- Matej Knopp
-
-
Constructor Summary
Constructors Constructor Description MockRequestParameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameterValue(String name, String value)
Adds value for given key.Set<String>
getParameterNames()
Returns immutable set of all available parameter names.StringValue
getParameterValue(String name)
Returns single value for parameter with specified name.List<StringValue>
getParameterValues(String name)
Returns list of values for parameter with specified name.void
reset()
Clears all parameters.void
setParameterValue(String name, String value)
Sets value for given key.void
setParameterValues(String name, List<StringValue> values)
Sets the values for given parameter.
-
-
-
Constructor Detail
-
MockRequestParameters
public MockRequestParameters()
-
-
Method Detail
-
getParameterNames
public Set<String> getParameterNames()
Description copied from interface:IRequestParameters
Returns immutable set of all available parameter names.- Specified by:
getParameterNames
in interfaceIRequestParameters
- Returns:
- list of parameter names
-
getParameterValue
public StringValue getParameterValue(String name)
Description copied from interface:IRequestParameters
Returns single value for parameter with specified name. This method always returns non-null result even if the parameter does not exist.- Specified by:
getParameterValue
in interfaceIRequestParameters
- Parameters:
name
- parameter name- Returns:
StringValue
wrapping the actual value- See Also:
StringValue.isNull()
-
getParameterValues
public List<StringValue> getParameterValues(String name)
Description copied from interface:IRequestParameters
Returns list of values for parameter with specified name. If the parameter does not exist this method returnsnull
- Specified by:
getParameterValues
in interfaceIRequestParameters
- Parameters:
name
- parameter name- Returns:
- list of all values for given parameter or
null
if parameter does not exist
-
setParameterValues
public void setParameterValues(String name, List<StringValue> values)
Description copied from interface:IWritableRequestParameters
Sets the values for given parameter.- Specified by:
setParameterValues
in interfaceIWritableRequestParameters
-
setParameterValue
public void setParameterValue(String name, String value)
Sets value for given key.- Parameters:
name
-value
-
-
addParameterValue
public void addParameterValue(String name, String value)
Adds value for given key.- Parameters:
name
-value
-
-
reset
public void reset()
Description copied from interface:IWritableRequestParameters
Clears all parameters.- Specified by:
reset
in interfaceIWritableRequestParameters
-
-