I am trying to create a generic method for object updates using scala / java but I can't get the class for a type parameter.
Here is my code:
object WorkUnitController extends Controller {
def updateObject[T](toUpdate: T, body: JsonObject){
val source = gson.fromJson(body, classOf[T]);
...
}
}
The error i get is
class type required but T found
I know in java you can't do it but is this possible in scala at all?
Thanks!