@ SuppressWarnings ( "unchecked" ) public static MultiValueMap < String , String > getParamsFromQueryString ( String queryString ) { MultiValueMap queryParams = new LinkedMultiValueMap <> ( ) ; if ( StringUtils . isNotEmpty ( queryString ) ) { String [ ] params = queryString . split ( "&" ) ; for ( String param : params ) { String [ ] splitParam = param . split ( "=" ) ; String paramName = splitParam [ 0 ] ; String paramValue = splitParam [ 1 ] ; queryParams . add ( paramName , paramValue ) ; } } return queryParams ; }
Returns a map with the extracted parameters from the specified query string . A multi value map is used since there can be several values for the same param .