Override equals and hashCode for DeviceEntity
This commit is contained in:
parent
8463eea777
commit
ba35eb76c2
|
|
@ -25,6 +25,20 @@ class DeviceEntity: AuditableUuidIdEntity() {
|
|||
)
|
||||
lateinit var users: Set<UserEntity>
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other == null || this.javaClass != other.javaClass) {
|
||||
return false
|
||||
}
|
||||
|
||||
other as DeviceEntity
|
||||
|
||||
return this.id == other.id
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return this.id.hashCode()
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun create(platform: DevicePlatform): DeviceEntity {
|
||||
return DeviceEntity().apply {
|
||||
|
|
|
|||
Loading…
Reference in New Issue