I need a "generic" cast based on a method param (className). Something like this:
void save(DomainObject o, String className) {
doSomething((className) o);
}
So I want to cast "o" right into an Object of the class "className".
I know how to instantiate an Object via the classname String, but are there any easy possibilities to manage my casting problem?