You can do this using the Class. cast() method , which dynamically casts the supplied parameter to the type of the class instance you have. To get the class instance of a particular field, you use the getType() method on the field in question.24 Oca 2010