public class MockRestRequest extends Object implements RestRequest
RestRequest.Method| Constructor and Description |
|---|
MockRestRequest(Map<String,String> params,
RestRequest.Method method,
String bodyContentNotForm) |
MockRestRequest(String path,
Map<String,String> params,
RestRequest.Method requestMethod,
String bodyContentNotForm) |
| Modifier and Type | Method and Description |
|---|---|
String |
contentAsString() |
byte[] |
contentByteArray() |
int |
contentByteArrayOffset() |
int |
contentLength() |
boolean |
contentUnsafe()
Is the byte array write safe or unsafe for usage on other threads
|
String |
cookie(String name) |
Object |
flash(String key) |
void |
flash(String key,
Object value) |
boolean |
hasContent() |
boolean |
hasParam(String key) |
String |
header(String name) |
javax.servlet.http.HttpServletRequest |
httpServletRequest() |
RestRequest.Method |
method() |
String |
param(String key) |
String |
param(String key,
String defaultValue) |
boolean |
paramAsBoolean(String key,
boolean defaultValue) |
Boolean |
paramAsBoolean(String key,
Boolean defaultValue) |
float |
paramAsFloat(String key,
float defaultValue) |
int |
paramAsInt(String key,
int defaultValue) |
long |
paramAsLong(String key,
long defaultValue) |
ByteSizeValue |
paramAsSize(String key,
ByteSizeValue defaultValue) |
String[] |
paramAsStringArray(String key,
String[] defaultValue) |
TimeValue |
paramAsTime(String key,
TimeValue defaultValue) |
String |
paramMultiKey(String... keys) |
Map<String,String> |
params() |
String |
path()
The path part of the URI (without the query string), decoded.
|
String |
queryString() |
String |
rawPath()
The non decoded, raw path provided.
|
Object |
session(String key) |
void |
session(String key,
Object value) |
String |
uri()
The uri of the rest request, with the query string.
|
String |
url() |
public MockRestRequest(Map<String,String> params, RestRequest.Method method, String bodyContentNotForm)
public RestRequest.Method method()
method in interface RestRequestpublic String uri()
RestRequesturi in interface RestRequestpublic String rawPath()
RestRequestrawPath in interface RestRequestpublic String url()
url in interface RestRequestpublic String queryString()
queryString in interface RestRequestpublic boolean hasContent()
hasContent in interface RestRequestpublic boolean contentUnsafe()
RestRequestcontentUnsafe in interface RestRequestpublic byte[] contentByteArray()
contentByteArray in interface RestRequestpublic int contentByteArrayOffset()
contentByteArrayOffset in interface RestRequestpublic int contentLength()
contentLength in interface RestRequestpublic String contentAsString()
contentAsString in interface RestRequestpublic String header(String name)
header in interface RestRequestpublic Map<String,String> params()
params in interface RestRequestpublic String cookie(String name)
cookie in interface RestRequestpublic Object session(String key)
session in interface RestRequestpublic void session(String key, Object value)
session in interface RestRequestpublic Object flash(String key)
flash in interface RestRequestpublic void flash(String key, Object value)
flash in interface RestRequestpublic javax.servlet.http.HttpServletRequest httpServletRequest()
httpServletRequest in interface RestRequestpublic boolean hasParam(String key)
hasParam in interface RestRequestpublic String param(String key)
param in interface RestRequestpublic String paramMultiKey(String... keys)
paramMultiKey in interface RestRequestpublic String param(String key, String defaultValue)
param in interface RestRequestpublic final String path()
RestRequestpath in interface RestRequestpublic float paramAsFloat(String key, float defaultValue)
paramAsFloat in interface RestRequestpublic int paramAsInt(String key, int defaultValue)
paramAsInt in interface RestRequestpublic long paramAsLong(String key, long defaultValue)
paramAsLong in interface RestRequestpublic boolean paramAsBoolean(String key, boolean defaultValue)
paramAsBoolean in interface RestRequestpublic Boolean paramAsBoolean(String key, Boolean defaultValue)
paramAsBoolean in interface RestRequestpublic TimeValue paramAsTime(String key, TimeValue defaultValue)
paramAsTime in interface RestRequestpublic ByteSizeValue paramAsSize(String key, ByteSizeValue defaultValue)
paramAsSize in interface RestRequestpublic String[] paramAsStringArray(String key, String[] defaultValue)
paramAsStringArray in interface RestRequestCopyright © 2021. All rights reserved.