mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Implement equals and hashCode for CategoryItem
This commit is contained in:
parent
4c0ea95670
commit
494739da5e
1 changed files with 16 additions and 0 deletions
|
|
@ -51,4 +51,20 @@ class CategoryItem implements Parcelable {
|
||||||
parcel.writeString(name);
|
parcel.writeString(name);
|
||||||
parcel.writeInt(selected ? 1 : 0);
|
parcel.writeInt(selected ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
CategoryItem that = (CategoryItem) o;
|
||||||
|
|
||||||
|
return name.equals(that.name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return name.hashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue