Here you can find the source of toMap(Properties properties)
Parameter | Description |
---|---|
properties | a parameter |
public static Map<String, String> toMap(Properties properties)
//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; } }