public class ParamMapping<ModelType,ValueType> extends Object
Constructor and Description |
---|
ParamMapping(String formParamName,
Class<ModelType> modelClass,
java.util.function.Function<ModelType,ValueType> modelFieldRetriever,
java.util.function.Function<String,ValueType> paramFieldRetriever) |
Modifier and Type | Method and Description |
---|---|
String |
getFormParamName()
Get the name of the form parameter.
|
ValueType |
getValue(javax.servlet.http.HttpServletRequest request)
Retrieve the value of the parameter, either from a servlet request's parameter, or from the JSON body of an API request.
|
public ParamMapping(String formParamName, Class<ModelType> modelClass, java.util.function.Function<ModelType,ValueType> modelFieldRetriever, java.util.function.Function<String,ValueType> paramFieldRetriever)
public String getFormParamName()
public ValueType getValue(javax.servlet.http.HttpServletRequest request) throws IOException
request
- The servlet request.IOException
- This is only thrown if the request is an API request and the JSON body cannot be deserialized
as an instance of the specified class.Copyright 2019 Ping Identity Corp. All rights reserved.