added hash code to folder.kt and image.kt to pair with equals

This commit is contained in:
Ben Shung Cano 2025-10-03 17:19:01 -04:00
parent d632c268ae
commit 5097dc7147
2 changed files with 19 additions and 0 deletions

View file

@ -39,4 +39,11 @@ data class Folder(
return true return true
} }
override fun hashCode(): Int {
var result = bucketId.hashCode()
result = 31 * result + name.hashCode()
result = 31 * result + images.hashCode()
return result
}
} }

View file

@ -121,4 +121,16 @@ data class Image(
override fun newArray(size: Int): Array<Image?> = arrayOfNulls(size) 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
}
} }