2021-10-14 19:25:25 +02:00
|
|
|
package org.moire.ultrasonic.domain
|
|
|
|
|
|
|
|
import androidx.room.Ignore
|
|
|
|
|
2021-10-19 21:02:51 +02:00
|
|
|
abstract class GenericEntry : Identifiable {
|
2021-10-14 19:25:25 +02:00
|
|
|
@Ignore
|
|
|
|
open val name: String? = null
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Identifiable : Comparable<Identifiable> {
|
|
|
|
val id: String
|
2021-11-30 20:53:10 +01:00
|
|
|
|
2021-10-16 11:30:51 +02:00
|
|
|
val longId: Long
|
2021-11-30 20:53:10 +01:00
|
|
|
get() = id.hashCode().toLong()
|
|
|
|
|
|
|
|
override fun compareTo(other: Identifiable): Int {
|
|
|
|
return longId.compareTo(other.longId)
|
|
|
|
}
|
2021-10-14 19:25:25 +02:00
|
|
|
}
|