I'm using the GSON library to parse a message in this way:
Message m = new Gson().fromJson(message, Message.class);
Now I need to parse another message with a complete different form. Message is:
{foo: "aaa", bar: "bbb" }
while the new format is:
{tag1: "ccc", tag2: "ddd"}
How can I distinguish the two formats?