Possible Duplicate:
deserializing generics with gson
So I need to do:
Type fluentType = new TypeToken<BruteForceFluentImpl<GtlDigestor.Data>>() {}.getType();
instead of
Type fluentType = new TypeToken<Fluent<T>>() {}.getType(); // <-- i want to be able to do something like this.
String json = gson.toJson(fluent, fluentType);
This means that every time I have to specify a different type parameter for the Fluent class, I need to change my code in order to specify it. Right now, the type parameter is GtlDigestor.Data
.
How do I do this? (the second line of code won't work)