public class HandlerRequestUtils extends Object
HandlerRequest
.Constructor and Description |
---|
HandlerRequestUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
fromRequestBodyOrQueryParameter(T requestValue,
SupplierWithException<T,RestHandlerException> queryParameterExtractor,
T defaultValue,
org.slf4j.Logger log)
Returns
requestValue if it is not null, otherwise returns the query parameter value
if it is not null, otherwise returns the default value. |
static <X,P extends MessageQueryParameter<X>,R extends RequestBody,M extends MessageParameters> |
getQueryParameter(HandlerRequest<R,M> request,
Class<P> queryParameterClass)
Returns the value of a query parameter, or
null if the query parameter is not set. |
static <X,P extends MessageQueryParameter<X>,R extends RequestBody,M extends MessageParameters> |
getQueryParameter(HandlerRequest<R,M> request,
Class<P> queryParameterClass,
X defaultValue) |
public static <X,P extends MessageQueryParameter<X>,R extends RequestBody,M extends MessageParameters> X getQueryParameter(HandlerRequest<R,M> request, Class<P> queryParameterClass) throws RestHandlerException
null
if the query parameter is not set.RestHandlerException
- If the query parameter is repeated.public static <X,P extends MessageQueryParameter<X>,R extends RequestBody,M extends MessageParameters> X getQueryParameter(HandlerRequest<R,M> request, Class<P> queryParameterClass, X defaultValue) throws RestHandlerException
RestHandlerException
public static <T> T fromRequestBodyOrQueryParameter(T requestValue, SupplierWithException<T,RestHandlerException> queryParameterExtractor, T defaultValue, org.slf4j.Logger log) throws RestHandlerException
requestValue
if it is not null, otherwise returns the query parameter value
if it is not null, otherwise returns the default value.RestHandlerException
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.