CumulocityAlarmStatuses status = alarmFilter.getStatus();
ManagedObjectRepresentation source = alarmFilter.getSource();
Date dateFrom = alarmFilter.getFromDate();
Date dateTo = alarmFilter.getToDate();
Map filter = new HashMap();
if (null != status) {
filter.put(PARAMETER_STATUS, status.name());
}
if (null != source) {
filter.put(PARAMETER_SOURCE, source.getId().getValue());
}
if (null != dateFrom) {
filter.put(DATE_FROM, DateUtils.format(dateFrom));
}
if (null != dateTo) {
filter.put(DATE_TO, DateUtils.format(dateTo));
}
QueryURLBuilder query = new QueryURLBuilder(templateUrlParser, filter, getAlarmsApiRepresentation().getURITemplates(),
OPTIONAL_PARAMETERS);
String queryUrl = query.build();