public class Feature{
private String name;
private int score;
Object value;
}
Now when serializing/deserializing :
Type mapType = new TypeToken<Map<String, Feature>>(){}.getType();
Map<String, Feature> map = gson.fromJson(string,mapType);
The Feature objects are being created correctly, but the inner value attribute does not retain its type. Instead of an object what gson returns is a TreeMap with keys the names of the objects fields and values their respective values. Is there any way to use GSON to deserialize java Object?