R
- type of the contained request bodypublic class HandlerRequest<R extends RequestBody> extends Object
RequestBody
and
path/query parameters.Modifier and Type | Method and Description |
---|---|
static <R extends RequestBody,M extends MessageParameters> |
create(R requestBody,
M messageParameters)
Short-cut for
create(RequestBody, MessageParameters, Collection) without any
uploaded files. |
static <R extends RequestBody,M extends MessageParameters> |
create(R requestBody,
M messageParameters,
Collection<File> uploadedFiles)
Creates a new
HandlerRequest . |
<X,PP extends MessagePathParameter<X>> |
getPathParameter(Class<PP> parameterClass)
Returns the value of the
MessagePathParameter for the given class. |
<X,QP extends MessageQueryParameter<X>> |
getQueryParameter(Class<QP> parameterClass)
Returns the value of the
MessageQueryParameter for the given class. |
R |
getRequestBody()
Returns the request body.
|
Collection<File> |
getUploadedFiles() |
static <R extends RequestBody,M extends MessageParameters> |
resolveParametersAndCreate(R requestBody,
M messageParameters,
Map<String,String> receivedPathParameters,
Map<String,List<String>> receivedQueryParameters,
Collection<File> uploadedFiles)
Creates a new
HandlerRequest after resolving the given MessageParameters
against the given query/path parameter maps. |
public R getRequestBody()
public <X,PP extends MessagePathParameter<X>> X getPathParameter(Class<PP> parameterClass)
MessagePathParameter
for the given class.X
- the value type that the parameter containsPP
- type of the path parameterparameterClass
- class of the parameterIllegalStateException
- if no value is defined for the given parameter classpublic <X,QP extends MessageQueryParameter<X>> List<X> getQueryParameter(Class<QP> parameterClass)
MessageQueryParameter
for the given class.X
- the value type that the parameter containsQP
- type of the query parameterparameterClass
- class of the parameter@Nonnull public Collection<File> getUploadedFiles()
@VisibleForTesting public static <R extends RequestBody,M extends MessageParameters> HandlerRequest<R> create(R requestBody, M messageParameters)
create(RequestBody, MessageParameters, Collection)
without any
uploaded files.@VisibleForTesting public static <R extends RequestBody,M extends MessageParameters> HandlerRequest<R> create(R requestBody, M messageParameters, Collection<File> uploadedFiles)
HandlerRequest
. The given MessageParameters
are expected to be
resolved.public static <R extends RequestBody,M extends MessageParameters> HandlerRequest<R> resolveParametersAndCreate(R requestBody, M messageParameters, Map<String,String> receivedPathParameters, Map<String,List<String>> receivedQueryParameters, Collection<File> uploadedFiles) throws HandlerRequestException
HandlerRequest
after resolving the given MessageParameters
against the given query/path parameter maps.
For tests it is recommended to resolve the parameters manually and use create(R, M)
.
HandlerRequestException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.