When using gson to a class, one of the classes variables can either be a String or a List. Is it possible to catch and fix this without making a whole new class where one class has String and the other List?
Here is an example of the class:
public class JsonClass
{
private List<Integer> range;
public List<Integer> getRange() { return range; }
}
This only works when the range is a List with Integers, but it can also just be a String. The gson message is: "Expected STRING but was BEGIN_ARRAY".