@Test public void testEquals() { long ino = 1234L; long size = 9876L; Instant modificationTime = Instant.now(); Instant inodeTime = Instant.now().plusSeconds(5); FileInfo fileInfo = new FileInfo(ino, modificationTime, inodeTime, size); assertThat(fileInfo).isEqualTo(fileInfo); assertThat(fileInfo).isNotEqualTo(null); assertThat(fileInfo).isNotEqualTo(inodeTime); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FileInfo other = (FileInfo) obj; return Objects.equals(inode, other.inode) && Objects.equals(mtime, other.mtime) && Objects.equals(ctime, other.ctime) && Objects.equals(size, other.size); }
FileInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FileInfo other = (FileInfo) obj; return Objects.equals(inode, other.inode) && Objects.equals(mtime, other.mtime) && Objects.equals(ctime, other.ctime) && Objects.equals(size, other.size); } }
FileInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FileInfo other = (FileInfo) obj; return Objects.equals(inode, other.inode) && Objects.equals(mtime, other.mtime) && Objects.equals(ctime, other.ctime) && Objects.equals(size, other.size); } FileInfo(long inode, FileTime mtime, FileTime ctime, long size);  FileInfo(long inode, Instant mtime, Instant ctime, long size); }
FileInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FileInfo other = (FileInfo) obj; return Objects.equals(inode, other.inode) && Objects.equals(mtime, other.mtime) && Objects.equals(ctime, other.ctime) && Objects.equals(size, other.size); } FileInfo(long inode, FileTime mtime, FileTime ctime, long size);  FileInfo(long inode, Instant mtime, Instant ctime, long size); static FileInfo of(Path path); long getInode(); FileTime getMtime(); FileTime getCtime(); long getSize(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
FileInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FileInfo other = (FileInfo) obj; return Objects.equals(inode, other.inode) && Objects.equals(mtime, other.mtime) && Objects.equals(ctime, other.ctime) && Objects.equals(size, other.size); } FileInfo(long inode, FileTime mtime, FileTime ctime, long size);  FileInfo(long inode, Instant mtime, Instant ctime, long size); static FileInfo of(Path path); long getInode(); FileTime getMtime(); FileTime getCtime(); long getSize(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }