package com.sw.dualscreen.objbox import io.objectbox.annotation.Entity import io.objectbox.annotation.HnswIndex import io.objectbox.annotation.Id import io.objectbox.annotation.VectorDistanceType @Entity data class Food( @Id var id: Long = 0, var name: String? = null, var foodIdx: Int = 0, @HnswIndex(dimensions = 512, distanceType = VectorDistanceType.DOT_PRODUCT) var foodVector: FloatArray? = null ) { override fun equals(other: Any?): Boolean { if (this === other) return true if (javaClass != other?.javaClass) return false other as Food if (id != other.id) return false if (foodIdx != other.foodIdx) return false if (name != other.name) return false if (!foodVector.contentEquals(other.foodVector)) return false return true } override fun hashCode(): Int { var result = id.hashCode() result = 31 * result + foodIdx result = 31 * result + (name?.hashCode() ?: 0) result = 31 * result + (foodVector?.contentHashCode() ?: 0) return result } }