mirror of
https://github.com/topjohnwu/jtar.git
synced 2024-11-23 03:19:41 +00:00
Making TarEntry.equals a standard java equals method (with .hashCode method)
This commit is contained in:
parent
e768f32bd1
commit
46a20204bc
@ -58,8 +58,18 @@ public class TarEntry {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public boolean equals(TarEntry it) {
|
||||
return header.name.toString().equals(it.header.name.toString());
|
||||
@Override
|
||||
public boolean equals(Object it) {
|
||||
if (!(it instanceof TarEntry)) {
|
||||
return false;
|
||||
}
|
||||
return header.name.toString().equals(
|
||||
((TarEntry) it).header.name.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return header.name.hashCode();
|
||||
}
|
||||
|
||||
public boolean isDescendent(TarEntry desc) {
|
||||
|
Loading…
Reference in New Issue
Block a user