Merge pull request #470 from Isira-Seneviratne/Data_classes
commit
b4bf607d3a
@ -1,29 +1,8 @@
|
|||||||
package org.koitharu.kotatsu.scrobbling.common.domain.model
|
package org.koitharu.kotatsu.scrobbling.common.domain.model
|
||||||
|
|
||||||
class ScrobblerUser(
|
data class ScrobblerUser(
|
||||||
val id: Long,
|
val id: Long,
|
||||||
val nickname: String,
|
val nickname: String,
|
||||||
val avatar: String,
|
val avatar: String,
|
||||||
val service: ScrobblerService,
|
val service: ScrobblerService,
|
||||||
) {
|
)
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
|
||||||
if (this === other) return true
|
|
||||||
if (javaClass != other?.javaClass) return false
|
|
||||||
|
|
||||||
other as ScrobblerUser
|
|
||||||
|
|
||||||
if (id != other.id) return false
|
|
||||||
if (nickname != other.nickname) return false
|
|
||||||
if (avatar != other.avatar) return false
|
|
||||||
return service == other.service
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
|
||||||
var result = id.hashCode()
|
|
||||||
result = 31 * result + nickname.hashCode()
|
|
||||||
result = 31 * result + avatar.hashCode()
|
|
||||||
result = 31 * result + service.hashCode()
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,51 +1,13 @@
|
|||||||
package org.koitharu.kotatsu.settings.userdata
|
package org.koitharu.kotatsu.settings.userdata
|
||||||
|
|
||||||
class StorageUsage(
|
data class StorageUsage(
|
||||||
val savedManga: Item,
|
val savedManga: Item,
|
||||||
val pagesCache: Item,
|
val pagesCache: Item,
|
||||||
val otherCache: Item,
|
val otherCache: Item,
|
||||||
val available: Item,
|
val available: Item,
|
||||||
) {
|
) {
|
||||||
|
data class Item(
|
||||||
class Item(
|
|
||||||
val bytes: Long,
|
val bytes: Long,
|
||||||
val percent: Float,
|
val percent: Float,
|
||||||
) {
|
)
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
|
||||||
if (this === other) return true
|
|
||||||
if (javaClass != other?.javaClass) return false
|
|
||||||
|
|
||||||
other as Item
|
|
||||||
|
|
||||||
if (bytes != other.bytes) return false
|
|
||||||
return percent == other.percent
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
|
||||||
var result = bytes.hashCode()
|
|
||||||
result = 31 * result + percent.hashCode()
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
|
||||||
if (this === other) return true
|
|
||||||
if (javaClass != other?.javaClass) return false
|
|
||||||
|
|
||||||
other as StorageUsage
|
|
||||||
|
|
||||||
if (savedManga != other.savedManga) return false
|
|
||||||
if (pagesCache != other.pagesCache) return false
|
|
||||||
if (otherCache != other.otherCache) return false
|
|
||||||
return available == other.available
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
|
||||||
var result = savedManga.hashCode()
|
|
||||||
result = 31 * result + pagesCache.hashCode()
|
|
||||||
result = 31 * result + otherCache.hashCode()
|
|
||||||
result = 31 * result + available.hashCode()
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,29 +1,8 @@
|
|||||||
package org.koitharu.kotatsu.sync.domain
|
package org.koitharu.kotatsu.sync.domain
|
||||||
|
|
||||||
class SyncAuthResult(
|
data class SyncAuthResult(
|
||||||
val host: String,
|
val host: String,
|
||||||
val email: String,
|
val email: String,
|
||||||
val password: String,
|
val password: String,
|
||||||
val token: String,
|
val token: String,
|
||||||
) {
|
)
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
|
||||||
if (this === other) return true
|
|
||||||
if (javaClass != other?.javaClass) return false
|
|
||||||
|
|
||||||
other as SyncAuthResult
|
|
||||||
|
|
||||||
if (host != other.host) return false
|
|
||||||
if (email != other.email) return false
|
|
||||||
if (password != other.password) return false
|
|
||||||
return token == other.token
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
|
||||||
var result = host.hashCode()
|
|
||||||
result = 31 * result + email.hashCode()
|
|
||||||
result = 31 * result + password.hashCode()
|
|
||||||
result = 31 * result + token.hashCode()
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
Reference in New Issue