use of cz.metacentrum.perun.core.api.exceptions.rt.InternalErrorRuntimeException in project perun by CESNET.
the class Auditable method compareByModifiedAt.
public int compareByModifiedAt(Auditable auditable) {
if (auditable == null || auditable.modifiedAt == null || this.modifiedAt == null) {
throw new InternalErrorRuntimeException(new NullPointerException("There is null pointer in auditable object or in createdAt"));
}
Date date1;
try {
date1 = BeansUtils.getDateFormatter().parse(modifiedAt);
} catch (Exception ex) {
throw new InternalErrorRuntimeException("There is problem with parsing createdAt in object " + this, ex);
}
Date date2;
try {
date2 = BeansUtils.getDateFormatter().parse(auditable.getModifiedAt());
} catch (Exception ex) {
throw new InternalErrorRuntimeException("There is problem with parsing createdAt in object " + auditable, ex);
}
return date1.compareTo(date2);
}
Aggregations