public static void validateAdd(Event event) { if (event == null) { throw new ValidationException("Parameter 'event' is mandatory but was not provided."); } if (event.getCustomId()==null) { throw new ValidationException("Parameter 'event.custom_id' is mandatory but was not provided."); } if (event.getDescription()==null) { throw new ValidationException("Parameter 'event.description' is mandatory but was not provided."); } if (event.getOrigin()==null) { throw new ValidationException("Parameter 'event.origin' is mandatory but was not provided."); } if (event.getSeverity()==null) { throw new ValidationException("Parameter 'event.severity' is mandatory but was not provided."); } }
protected void verifyModel(Event model, int index) { assertNotNull(model); assertEquals(model.getId(), String.valueOf(LOG_IDS[index])); assertEquals(LogSeverity.ALERT, model.getSeverity()); assertEquals(model.getDescription(), MESSAGES[index]); assertEquals(model.getOrigin(), ORIGIN_NAMES[index]); assertEquals(model.getCustomId(), CUSTOMER_EVENT_IDS[index]); }
@Mapping(from = Event.class, to = AuditLog.class) public static AuditLog map(Event event, AuditLog entity) { AuditLog auditLog = (entity != null) ? entity : new AuditLog(); AuditLogSeverity severity = map(event.getSeverity(), null); if (severity != null) { auditLog.setSeverity(severity);
to.setSeverity(from.getSeverity().value());