Is there a way to "Switch On Class"?

Not safe if you decide to rename a class