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

22 lines
509 B
Kotlin

package org.moire.ultrasonic.domain
import androidx.room.Ignore
abstract class GenericEntry : Identifiable {
abstract override val id: String
@Ignore
open val name: String? = null
override fun compareTo(other: Identifiable): Int {
return this.id.toInt().compareTo(other.id.toInt())
}
@delegate:Ignore
override val longId: Long by lazy {
id.hashCode().toLong()
}
}
interface Identifiable : Comparable<Identifiable> {
val id: String
val longId: Long
}