ultrasonic-app-subsonic-and.../core/domain/src/main/kotlin/org/moire/ultrasonic/domain/GenericEntry.kt

20 lines
572 B
Kotlin

package org.moire.ultrasonic.domain
abstract class GenericEntry {
// TODO: Should be non-null!
abstract val id: String?
open val name: String? = null
// These are just a formality and will never be called,
// because Kotlin data classes will have autogenerated equals() and hashCode() functions
override operator fun equals(other: Any?): Boolean {
return this === other
}
override fun hashCode(): Int {
var result = id?.hashCode() ?: 0
result = 31 * result + (name?.hashCode() ?: 0)
return result
}
}