How can I convert Any objects to objects of the correct types knowing only the names?

It is possible to cast an object to a type derived from its name at runtime.
You can get java class from string using Class.forName(...) method and then use Java Class::cast(documentation here) to perform safe cast. But since the type information is accessible only in runtime, compiler won’t be able to use it. So the type will be correct, but you cant designate it as T,. It is sometimes useful, when you are using type from some external configuration and generating objects by reflections, but should be avoided otherwise.

Another possibility is the usage of kotlin reified inline function types:

inline fun <reified T: Any> Any.cast(): T{
  return this as T
}

val a: Any
val b = a cast<B>()

But I cant’t see how it is better then simple cast.