/** * Orders two entries such that the more recently updated entry comes first. */ @Override public int compare(BaseContentEntry<?> e1, BaseContentEntry<?> e2) { int compare = e1.getUpdated().compareTo(e2.getUpdated()); return forward ? compare : -compare; } }
@Override protected void validate() throws IllegalStateException { if (startTime == null) { throwExceptionForMissingAttribute(START_TIME); } if (endTime != null) { if (startTime.compareTo(endTime) > 0) { throw new IllegalStateException( "g:when/@startTime must be less than or equal to g:when/@endTime."); } if (startTime.isDateOnly() != endTime.isDateOnly()) { throw new IllegalStateException( (startTime.isDateOnly() ? "Date" : "Date/time") + " value expected."); } } }
@Override protected void validate() throws IllegalStateException { if (startTime == null) { throwExceptionForMissingAttribute(START_TIME); } if (endTime != null) { if (startTime.compareTo(endTime) > 0) { throw new IllegalStateException( "g:when/@startTime must be less than or equal to g:when/@endTime."); } if (startTime.isDateOnly() != endTime.isDateOnly()) { throw new IllegalStateException( (startTime.isDateOnly() ? "Date" : "Date/time") + " value expected."); } } }
@Override protected void validate() throws IllegalStateException { if (startTime == null) { throwExceptionForMissingAttribute(START_TIME); } if (endTime != null) { if (startTime.compareTo(endTime) > 0) { throw new IllegalStateException( "g:when/@startTime must be less than or equal to g:when/@endTime."); } if (startTime.isDateOnly() != endTime.isDateOnly()) { throw new IllegalStateException( (startTime.isDateOnly() ? "Date" : "Date/time") + " value expected."); } } }