Java Map Put putParameter(String key, String value, Map map)

Here you can find the source of putParameter(String key, String value, Map map)

Description

put Parameter

License

Apache License

Declaration

private static void putParameter(String key, String value, Map<String, Object> map) 

Method Source Code

//package com.java2s;
/*/*from  w w w  .  j  a  v  a  2  s. com*/
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.util.Map;

public class Main {
    private static void putParameter(String key, String value, Map<String, Object> map) {
        if (key.startsWith("$P{")) {
            // more values
            Object obj = value;
            if (value.startsWith("[") && value.endsWith("]")) {
                String[] array = value.substring(1, value.length() - 1).split(",");
                obj = array;
            }
            map.put(key.substring(3, key.length() - 1), obj);
        }
    }
}

Related

  1. putObject(Map map, V key, W value)
  2. putObjectsInMultiMap(Map>> multiMap, Integer key, List stringPair)
  3. putOrCreateList(Map> map, K key, V value)
  4. putOrRemove(Map map, String key, Object obj)
  5. putPairs(Map map, Object... pairs)
  6. putPreferenceStoredMapValue(String keyOfPreference, String keyInMap, Object value)
  7. putRowMap(Map map, String value)
  8. putSafelyMap(Map> pathFeaturesMap, K1 featureDescriptor, K2 pathId, E featureValue)
  9. putShort(Map properties, String name, short value)