use of org.camunda.bpm.engine.rest.dto.converter.IntegerConverter in project camunda-bpm-platform by camunda.
the class MetricsRestServiceImpl method applyQueryParams.
protected void applyQueryParams(MetricsQuery query, MultivaluedMap<String, String> queryParameters) {
DateConverter dateConverter = new DateConverter();
dateConverter.setObjectMapper(objectMapper);
if (queryParameters.getFirst(QUERY_PARAM_START_DATE) != null) {
Date startDate = dateConverter.convertQueryParameterToType(queryParameters.getFirst(QUERY_PARAM_START_DATE));
query.startDate(startDate);
}
if (queryParameters.getFirst(QUERY_PARAM_END_DATE) != null) {
Date endDate = dateConverter.convertQueryParameterToType(queryParameters.getFirst(QUERY_PARAM_END_DATE));
query.endDate(endDate);
}
IntegerConverter intConverter = new IntegerConverter();
intConverter.setObjectMapper(objectMapper);
if (queryParameters.getFirst(QUERY_PARAM_FIRST_RESULT) != null) {
int firstResult = intConverter.convertQueryParameterToType(queryParameters.getFirst(QUERY_PARAM_FIRST_RESULT));
query.offset(firstResult);
}
if (queryParameters.getFirst(QUERY_PARAM_MAX_RESULTS) != null) {
int maxResults = intConverter.convertQueryParameterToType(queryParameters.getFirst(QUERY_PARAM_MAX_RESULTS));
query.limit(maxResults);
}
}
Aggregations