Converts java.util.Map into java.util.Properties - Java Collection Framework

Java examples for Collection Framework:Map

Description

Converts java.util.Map into java.util.Properties

Demo Code


//package com.java2s;

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

public class Main {
    /**/*from   www.j av a  2s .  co  m*/
     * 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;
    }
}

Related Tutorials