Java Properties to Map toMap(Properties properties)

Here you can find the source of toMap(Properties properties)

Description

to Map

License

Open Source License

Parameter

Parameter Description
properties a parameter

Declaration

public static Map<String, String> toMap(Properties properties) 

Method Source Code

//package com.java2s;

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

public class Main {
    /**/*from   w  w w.  jav a 2 s. c om*/
     * @param properties
     * @return
     */
    public static Map<String, String> toMap(Properties properties) {
        Map<String, String> map = new HashMap<String, String>();
        if (properties == null) {
            return map;
        }

        for (Object key : properties.keySet()) {
            map.put((String) key, properties.getProperty((String) key));
        }

        return map;
    }
}

Related

  1. toMap(Properties properties)
  2. toMap(Properties properties)
  3. toMap(Properties properties)
  4. toMap(Properties properties)
  5. toMap(Properties properties)
  6. toMap(Properties properties)
  7. toMap(Properties properties)
  8. toMap(Properties props)
  9. toMap(Properties props)