mercredi 16 septembre 2015

How do I get ClassTag from String to pass to a Scala Function as a type parameter?

I have a Scala function that is defined like

def func[VD <: kafka.serializer.Decoder[V] : ClassTag](data : Int) = { ... }

I have the class name of VD that I am going to use while calling this function as a string e.g. com.company.CustomDecoder. How do I call the function above with the correct ClassTag?





Aucun commentaire:

Enregistrer un commentaire