0

I am struggling to deserialize a string into HashMap. My string looks like this:

String str = "{key=qwerty, value=somestring}";

I have tried Jackson to convert it back to HashMap but Jackson works on JSON so it requires me to have double-quotes. Is there a way to do it without converting the string to JSON format?

unitSphere
  • 241
  • 3
  • 17
  • Unlikely, as JSON is only supported because it's a standard format. Writing a parser for this wouldn't take much time though. – markspace Jul 13 '20 at 02:25
  • 1
    You could write a parser fairly easily, but you would need two know how an equals sign, a comma or a closing brace is represented in a string in this format. Do you have that information? – tgdavies Jul 13 '20 at 02:35
  • possible duplicate https://stackoverflow.com/questions/10514473/string-to-hashmap-java/10514517 – spandey Jul 13 '20 at 05:35

0 Answers0