Is there any general function (in apache commons or similar) for creating maps from strings with query parameters?
In particular:
Option a (Querystring)
s="a=1&b=3" => Utils.mapFunction(s, '&', '=') => (Hash)Map { a:1; b:3 }
Option b (Cachecontrol-Header)
s="max-age=3600;must-revalidate" => Utils.mapFunction(s, ';', '=') => (Hash)Map { max-age:3600; must-revalidate:true }
I do not want to reinvent the wheel.
thanks
java string map
boecko
source share