public static Map<String, Deque<String>> parseQueryString(final String newQueryString, final String encoding) {
        Map<String, Deque<String>> newQueryParameters = new LinkedHashMap<>();
        int startPos = 0;
        int equalPos = -1;
        boolean needsDecode = false;
        for(int i = 0; i < newQueryString.length(); ++i) {
            char c = newQueryString.charAt(i);
            if(c == '=' && equalPos == -1) {
                equalPos = i;
            } else if(c == '&') {
                handleQueryParameter(newQueryString, newQueryParameters, startPos, equalPos, i, encoding, needsDecode);
                needsDecode = false;
                startPos = i + 1;
                equalPos = -1;
            } else if((c == '%' || c == '+') && encoding != null) {
                needsDecode = true;
            }
        }
        if(startPos != newQueryString.length()) {
            handleQueryParameter(newQueryString, newQueryParameters, startPos, equalPos, newQueryString.length(), encoding, needsDecode);
        }
        return newQueryParameters;
    }
public static Map < String , Deque < String > > parseQueryString ( final String newQueryString , final String encoding ) { Map < String , Deque < String > > newQueryParameters = new LinkedHashMap < > ( ) ; int startPos = 0 ; int equalPos = - 1 ; boolean needsDecode = false ; for ( int i = 0 ; i < newQueryString . length ( ) ; ++ i ) { char c = newQueryString . charAt ( i ) ; if ( c == '=' && equalPos == - 1 ) { equalPos = i ; } else if ( c == '&' ) { handleQueryParameter ( newQueryString , newQueryParameters , startPos , equalPos , i , encoding , needsDecode ) ; needsDecode = false ; startPos = i + 1 ; equalPos = - 1 ; } else if ( ( c == '%' || c == '+' ) && encoding != null ) { needsDecode = true ; } } if ( startPos != newQueryString . length ( ) ) { handleQueryParameter ( newQueryString , newQueryParameters , startPos , equalPos , newQueryString . length ( ) , encoding , needsDecode ) ; } return newQueryParameters ; }
Parses a query string into a map
@param newQueryString The query string
@return The map of key value parameters