@@ -8,7 +8,6 @@ import org.apache.solr.client.solrj.beans.Field
8
8
import org .scalatest .concurrent .Eventually .eventually
9
9
import org .scalatest .concurrent .PatienceConfiguration .Timeout
10
10
11
- import scala .annotation .meta .field
12
11
import scala .jdk .CollectionConverters ._
13
12
import scala .concurrent .duration ._
14
13
@@ -202,9 +201,48 @@ class AsyncSolrClientFunSpec extends StandardFunSpec with RunningSolr {
202
201
203
202
}
204
203
204
+ /*
205
205
case class TestBean(@(Field @field) id: String,
206
206
@(Field @field) name: String,
207
207
@(Field @field) category: String,
208
208
@(Field @field) price: Float) {
209
209
def this() = this(null, null, null, 0)
210
210
}
211
+ */
212
+
213
+ /* Can be replaced by the version above, once
214
+ https://github.com/lampepfl/dotty/issues/12492 respectively https://github.com/lampepfl/dotty/pull/16445
215
+ are released (see https://github.com/lampepfl/dotty/releases)
216
+ */
217
+ class TestBean (_id : String , _name : String , _category : String , _price : Float ) {
218
+ def this () = this (null , null , null , 0 )
219
+
220
+ @ Field
221
+ val id : String = _id
222
+ @ Field
223
+ val name : String = _name
224
+ @ Field
225
+ val category : String = _category
226
+ @ Field
227
+ val price : Float = _price
228
+
229
+ override def equals (other : Any ): Boolean = other match {
230
+ case that : TestBean =>
231
+ id == that.id &&
232
+ name == that.name &&
233
+ category == that.category &&
234
+ price == that.price
235
+ case _ => false
236
+ }
237
+
238
+ override def hashCode (): Int = {
239
+ val state = Seq (id, name, category, price)
240
+ state.map(_.hashCode()).foldLeft(0 )((a, b) => 31 * a + b)
241
+ }
242
+
243
+ }
244
+
245
+ object TestBean {
246
+ def apply (id : String , name : String , category : String , price : Float ): TestBean =
247
+ new TestBean (_id = id, _name = name, _category = category, _price = price)
248
+ }
0 commit comments