将java.util.Map转换为java.util.Properties
//package com.nowjava; /** from * 时代Java - nowjava.com **/ import java.util.Map; import java.util.Properties; public class Main { /** * Converts java.util.Map into java.util.Properties * @param map Map to convert * @return Properties, created from given map */ public static Properties asProperties(Map<Object, Object> map) { Properties properties = new Properties(); properties.putAll(map); return properties; } }