public class ParamsRetriever
extends com.thetransactioncompany.jsonrpc2.util.NamedParamsRetriever
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULTPARAM_COUNT
Default result set size parameter name.
|
static String |
DEFAULTPARAM_LIMIT
Default records limit parameter name.
|
static String |
DEFAULTPARAM_PAGE
Default page number parameter name.
|
static String |
DEFAULTPARAM_RECORDS
Default page records parameter name.
|
static String |
DEFAULTPARAM_SORT
Default sort specification parameter name.
|
static com.fasterxml.jackson.databind.ObjectMapper |
OBJECT_MAPPER
Jackson data binder.
|
| Constructor and Description |
|---|
ParamsRetriever(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request)
Initializes retriever for given request.
|
ParamsRetriever(Map<String,Object> params)
Initializes retriever with given parameters set.
|
| Modifier and Type | Method and Description |
|---|---|
<Type> Type |
getBean(Class<Type> type)
Retrieves typed bean from current parameters.
|
<Type> Type |
getBean(String param,
Class<Type> type)
Retrieves typed bean from sub-map located under specified entry.
|
<Type> Type |
getBean(String param,
Class<Type> type,
boolean allowNull)
Retrieves typed bean from sub-map located under specified entry.
|
UUID |
getOptUuid(String param)
Returns UUID identifier from given optional parameter (not allowing null).
|
UUID |
getOptUuid(String param,
boolean allowNull)
Returns UUID identifier from given optional parameter.
|
org.springframework.data.domain.Pageable |
getPageable(int defaultLimit)
Builds paged request data from default parameters names.
|
org.springframework.data.domain.Pageable |
getPageable(String pageParam,
String limitParam,
String sortParam,
int defaultLimit)
Builds sort ordering criteria list.
|
org.springframework.data.domain.Sort |
getSort(String param)
Builds sort ordering criteria list.
|
UUID |
getUuid(String param)
Returns UUID identifier from given parameter (not allowing null).
|
UUID |
getUuid(String param,
boolean allowNull)
Returns UUID identifier from given parameter.
|
ensureParam, ensureParam, ensureParam, ensureParameter, ensureParameter, ensureParameter, ensureParameters, ensureParameters, ensureParams, ensureParams, get, get, get, getBoolean, getDouble, getEnum, getEnum, getEnumString, getEnumString, getFloat, getInt, getList, getList, getLong, getMap, getMap, getNames, getOpt, getOpt, getOptBoolean, getOptDouble, getOptEnum, getOptEnum, getOptEnumString, getOptEnumString, getOptFloat, getOptInt, getOptList, getOptList, getOptLong, getOptMap, getOptMap, getOptString, getOptString, getOptStringArray, getOptStringArray, getParams, getString, getString, getStringArray, getStringArray, hasParam, hasParameter, hasParameters, hasParameters, hasParams, hasParams, sizepublic static final String DEFAULTPARAM_PAGE
public static final String DEFAULTPARAM_LIMIT
public static final String DEFAULTPARAM_SORT
public static final String DEFAULTPARAM_RECORDS
public static final String DEFAULTPARAM_COUNT
public static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
public ParamsRetriever(Map<String,Object> params)
params - Parameters map.public ParamsRetriever(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request)
request - JSON-RPC request.public UUID getUuid(String param) throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
param - Parameter name.com.thetransactioncompany.jsonrpc2.JSONRPC2Error - On a missing parameter, bad type or null value (JSONRPC2Error.INVALID_PARAMS).public UUID getUuid(String param, boolean allowNull) throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
param - Parameter name.allowNull - Whether to allow NULL values or throw exception in such case.com.thetransactioncompany.jsonrpc2.JSONRPC2Error - On a missing parameter or bad type or null value (JSONRPC2Error.INVALID_PARAMS).public UUID getOptUuid(String param) throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
param - Parameter name.com.thetransactioncompany.jsonrpc2.JSONRPC2Error - On a missing parameter, bad type or null value (JSONRPC2Error.INVALID_PARAMS).public UUID getOptUuid(String param, boolean allowNull) throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
param - Parameter name.allowNull - Whether to allow NULL values or throw exception in such case.com.thetransactioncompany.jsonrpc2.JSONRPC2Error - On a missing parameter, bad type or null value (JSONRPC2Error.INVALID_PARAMS).public org.springframework.data.domain.Sort getSort(String param) throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
param - Parameter name.com.thetransactioncompany.jsonrpc2.JSONRPC2Error - On a missing parameter, bad type or null value (JSONRPC2Error.INVALID_PARAMS).public org.springframework.data.domain.Pageable getPageable(String pageParam, String limitParam, String sortParam, int defaultLimit) throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
pageParam - Page number parameter name.limitParam - Results limit parameter name.sortParam - Sort specification parameter name.defaultLimit - Default page limit.com.thetransactioncompany.jsonrpc2.JSONRPC2Error - On a missing parameter, bad type or null value (JSONRPC2Error.INVALID_PARAMS).public org.springframework.data.domain.Pageable getPageable(int defaultLimit)
throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
defaultLimit - Default page limit.com.thetransactioncompany.jsonrpc2.JSONRPC2Error - On a missing parameter, bad type or null value (JSONRPC2Error.INVALID_PARAMS).public <Type> Type getBean(Class<Type> type)
Type - Destination bean type.type - Destination bean class.public <Type> Type getBean(String param, Class<Type> type, boolean allowNull) throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
Type - Destination bean type.param - Property map parameter name.type - Destination bean class.allowNull - Whether NULL should be accepted as bean value.com.thetransactioncompany.jsonrpc2.JSONRPC2Error - When parameters reading fails.public <Type> Type getBean(String param, Class<Type> type) throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
Type - Destination bean type.param - Property map parameter name.type - Destination bean class.com.thetransactioncompany.jsonrpc2.JSONRPC2Error - When parameters reading fails.Copyright © 2015 RafaĆ Wrzeszcz - Wrzasq.pl. All rights reserved.