I want to be able to have a map implementation of type [String,Any] in which i can store objects of different classes then i want to be able to do
import app.User;
....
usr = map.getAs("user",User)// with usr being an object of Class/Object User. If user is not of that type it throws an exception.
where user was previously stored in the map.
Is this possible?
I can even be a standalone method e.g
usr = getAs(map,"user",User)
Thanks