Alright this is kind of a complicated question and I'm completely lost.
Assume you have a string, and a generic class. Like this.
String string;
Class<?> clazz;
How would you check to see if the String represented a value that the class could equal.
For example lets say that:
String string = "true";
Class<?> clazz = Boolean.class;
How would I check and see that the string "true" is in fact a boolean?
Here is another example. Lets say that:
String string = "true";
Class<?> clazz = Integer.class;
How would I check and see that the string "true" is not an Integer?