Java Map Create createMapFromProperties(Properties stringSubstitutionVariables)

Here you can find the source of createMapFromProperties(Properties stringSubstitutionVariables)

Description

create Map From Properties

License

Open Source License

Declaration

public static Map<String, String> createMapFromProperties(Properties stringSubstitutionVariables) 

Method Source Code

//package com.java2s;
/**//from  w  w w  .  ja v a  2 s  .c o m
 * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Eclipse Public License (EPL).
 * Please see the license.txt included with this distribution for details.
 * Any modifications to this file must keep this entire header intact.
 */

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.Map.Entry;

public class Main {
    public static Map<String, String> createMapFromProperties(Properties stringSubstitutionVariables) {
        HashMap<String, String> map = new HashMap<String, String>();
        Set<Entry<Object, Object>> entrySet = stringSubstitutionVariables.entrySet();
        for (Entry<Object, Object> entry : entrySet) {
            map.put((String) entry.getKey(), (String) entry.getValue());
        }
        return map;
    }
}

Related

  1. createMap(T... _args)
  2. createMap(U... items)
  3. createMap_pollutantHourly()
  4. createMapFor(String... args)
  5. createMapFromArgs(Object... args)
  6. createMapFromWebsiteList(String[] websiteList)
  7. map(final Entry... entries)
  8. map(final Object... keysAndValues)
  9. map(final Properties props)