public int compareTo(final FileDetails o) { if (o == null) { throw new NullPointerException(); } // N.B. this is in reverse order to how we'd normally compare int result = o.getFile().compareTo(this.file); if (result == 0) { result = ObjectUtils.nullSafeComparison(o.getLastModified(), this.lastModified); } return result; }
@Override public int hashCode() { return 7 * this.file.hashCode() * ObjectUtils.nullSafeHashCode(lastModified); }