Im still unsure (per the comments on the question) that the original string is correctly formatted. I think some chars got moved around when you where replacing values with dummy data. I don't think there is a logical transition from your original string to the serialized string
Take a look at this
final String opString = "type=event&groups%5B%5D=a&groups%5B%5D=b&details%5Bclient_time%5D=Sat+Jan+30+2016+18%3A38%3A57+GMT-0500+(EST)";
System.out.println(URLDecoder.decode(opString, "UTF-8"));
which outputs
type=event&groups[]=a&groups[]=b&details[client_time]=Sat Jan 30 2016 18:38:57 GMT-0500 (EST)
Where is my interpretation of your string
final String myString = "type%3Devent%26groups%3D%5B%27a%27%2C%27b%27%5D%26details%5Bclient_time%5D=Sat+Jan+30+2016+18%3A38%3A57+GMT-0500+(EST)";
System.out.println(URLDecoder.decode(myString, "UTF-8"));
which output
type=event&groups=['a','b']&details[client_time]=Sat Jan 30 2016 18:38:57 GMT-0500 (EST)
I can logically work with that to produce the string you want
final String myStringDecoded = URLDecoder.decode(myString, "UTF-8");
System.out.println(myStringDecoded);
// Then we can break it down to its parts
// The & is used to operate values
String[] parts = myStringDecoded.split("&");
JsonObject json = new JsonObject();
for(String part: parts){
String[] keyVal = part.split("="); // The equal separates key and values
json.addProperty(keyVal[0], keyVal[1]);
}
System.out.println(json);
which results in
{"type":"event","groups":"['a','b']","details[client_time]":"Sat Jan 30 2016 18:38:57 GMT-0500 (EST)"}
I can improve on this answer to make it exactly what you want if my assumptions are correct
type=event&groups[]=a&groups[]=b&details[client_time]=Sat Jan 30 2016 18:38:57 GMT-0500 (EST)Does that look right? Because I think it should be this:type%3Devent%26groups%3D%5B%27a%27%2C%27b%27%5D%26+details%3Dclient_time%3D%27Sat+Jan+30+2016+18%3A38%3A57+GMT-0500+%28EST%29%27groups%5B%5D=aresults ingroups[]=a...