It is something as the code below. I found isAssignableFrom
in Java but it's not in scala.
trait A
def isTraitA(c:Class[_]) = {
// check if c implements A
// something like
// classOf[A].isAssignableFrom(c)
}
isTraitA(this.getClass)
Aucun commentaire:
Enregistrer un commentaire