示例#1
0
 public static boolean validate(Event event) {
   if (event == null) return false;
   Validator validator = Validator.getValidator();
   validator.notNull(event.getDate(), "\"Date\" must be specified");
   validator.notEmpty(event.getMessage(), "\"Message\" must be specified");
   boolean isValid = validator.isValid();
   return isValid;
 }
示例#2
0
 public static Event clone(Event event) {
   if (event == null) return null;
   Event clone = create();
   clone.setId(ObjectUtil.clone(event.getId()));
   clone.setDate(ObjectUtil.clone(event.getDate()));
   clone.setMessage(ObjectUtil.clone(event.getMessage()));
   return clone;
 }