mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
added hash code to folder.kt and image.kt to pair with equals
This commit is contained in:
parent
d632c268ae
commit
5097dc7147
2 changed files with 19 additions and 0 deletions
|
|
@ -39,4 +39,11 @@ data class Folder(
|
|||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = bucketId.hashCode()
|
||||
result = 31 * result + name.hashCode()
|
||||
result = 31 * result + images.hashCode()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,4 +121,16 @@ data class Image(
|
|||
|
||||
override fun newArray(size: Int): Array<Image?> = arrayOfNulls(size)
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = id.hashCode()
|
||||
result = 31 * result + bucketId.hashCode()
|
||||
result = 31 * result + name.hashCode()
|
||||
result = 31 * result + uri.hashCode()
|
||||
result = 31 * result + path.hashCode()
|
||||
result = 31 * result + bucketName.hashCode()
|
||||
result = 31 * result + sha1.hashCode()
|
||||
result = 31 * result + date.hashCode()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue