I'm trying to call a member from a generic type and here is an original way to run the function
SourceStruct is the object that I want to replace with something like T.
override def process(t: SourceStruct, runtimeContext: RuntimeContext, requestIndexer: RequestIndexer): Unit = {
        val json = new util.HashMap[String, String]()
        json.put("time", t.rating.toString)
        json.put("userId", t.userId.id.toString)
        json.put("itemId", t.itemId.id)
        requestIndexer.add(request)
      }
when I replace the SourceStruct with T, how can I call the t.userId?
override def process(t: T, runtimeContext: RuntimeContext, requestIndexer: RequestIndexer): Unit = {
      val json = new util.HashMap[String, String]()
//      json.put("userId", t.userId.id)
//      json.put("itemId", t.itemId.id)
//      json.put("rating", t.rating.toString)
      val request = Requests
        .indexRequest()
        .index(index)
        .`type`(indexType)
        .source(json)
      requestIndexer.add(request)
    }
thanks in advance
I can get the member by using
typeOf[T].members.collect {
case m: MethodSymbol if m.isCaseAccessor => m
}.toList
but still no clue about the question above
EDIT:
for example:
case class ExampleClass(x: Int, y: Int)
case class ExampleClass2(xx: Int, yy: Int)
then in the process function, how can I assign value to the member
override def process(t: T, ...) = {
    //t.x = 10 or t.xx = 10 ???
}
SOLVED
 
     
    