Java Map Replace replaceMethodUriWithValues(String methodUri, Map urlParameterKeyValues)

Here you can find the source of replaceMethodUriWithValues(String methodUri, Map urlParameterKeyValues)

Description

Replace input parameters in the URL with correct values

License

Apache License

Parameter

Parameter Description
methodUri a parameter
urlParameterKeyValues a parameter

Declaration

public static String replaceMethodUriWithValues(String methodUri, Map<String, String> urlParameterKeyValues) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Map;

public class Main {
    /**//from   w w w .  j  a v  a2 s  . c  o  m
     * Replace input parameters in the URL with correct values
     * @param methodUri
     * @param urlParameterKeyValues
     * @return
     */
    public static String replaceMethodUriWithValues(String methodUri, Map<String, String> urlParameterKeyValues) {
        String uri = methodUri;
        for (String key : urlParameterKeyValues.keySet()) {
            uri = uri.replace(new String(key), new String(urlParameterKeyValues.get(key)));
        }
        return uri;
    }
}

Related

  1. replaceKey(final Map map, final TKey oldkey, final TKey newkey)
  2. replaceKey(Map map, K oldKey, K newKey)
  3. replaceKeyCharacter(Map map, char oldChar, char newChar)
  4. replaceKeyword(String messageTemplate, Map args, String key)
  5. replaceMap(String inStr, Map replaceMap)
  6. replaceNode(Map map, Map replacement, List pathItems)
  7. replaceNotContainedWithReplaced(String sentStr, Map mapNotContainedReplaced)
  8. replaceOpcodeNames(HashMap replacementValues, final String input)
  9. replaceParameters(final String value, final Map paramMap)