是否有任何常见的函数(在apache commons或类似中)从类似查询参数的字符串制作映射?
具体到:
变体a(Querystring)
s="a=1&b=3"
=> Utils.mapFunction(s, '&', '=')
=> (Hash)Map { a:1; b:3 }
Run Code Online (Sandbox Code Playgroud)
变体b(Cachecontrol-Header)
s="max-age=3600;must-revalidate"
=> Utils.mapFunction(s, ';', '=')
=> (Hash)Map { max-age:3600; must-revalidate:true }
Run Code Online (Sandbox Code Playgroud)
我不想重新发明轮子.
谢谢