use of com.fasterxml.jackson.annotation.JsonGetter in project ma-modules-public by infiniteautomation.
the class EventInstanceModel method getComments.
@JsonGetter
public List<UserCommentModel> getComments() {
List<UserCommentModel> commentModels = new ArrayList<UserCommentModel>();
List<UserCommentVO> comments = this.data.getEventComments();
if (comments == null)
return null;
for (UserCommentVO comment : comments) {
commentModels.add(new UserCommentModel(comment));
}
return commentModels;
}
use of com.fasterxml.jackson.annotation.JsonGetter in project ma-core-public by infiniteautomation.
the class AbstractDataSourceModel method getAlarmLevels.
@JsonGetter(value = "alarmLevels")
public Map<String, String> getAlarmLevels() {
ExportCodes eventCodes = this.data.getEventCodes();
Map<String, String> alarmCodeLevels = new HashMap<>();
if (eventCodes != null && eventCodes.size() > 0) {
for (int i = 0; i < eventCodes.size(); i++) {
int eventId = eventCodes.getId(i);
int level = this.data.getAlarmLevel(eventId, AlarmLevels.URGENT);
alarmCodeLevels.put(eventCodes.getCode(eventId), AlarmLevels.CODES.getCode(level));
}
}
return alarmCodeLevels;
}
Aggregations