Extracting choice return type defined in DAML templates as a Java type

If you want to write dynamic, generic code you’ll probably need to parse Daml-LF. See a similar discussion for some of the reasons we don’t recommend going down that path.