Java Properties to Map toMap(Properties props)

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

Description

to Map

License

Apache License

Declaration

public static Map<String, Object> toMap(Properties props) 

Method Source Code

//package com.java2s;
// Copyright 2012 Citrix Systems, Inc. Licensed under the

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

public class Main {
    public static Map<String, Object> toMap(Properties props) {
        Set<String> names = props.stringPropertyNames();
        HashMap<String, Object> map = new HashMap<String, Object>(names.size());
        for (String name : names) {
            map.put(name, props.getProperty(name));
        }/*from www .  ja v  a 2s  . c o m*/

        return map;
    }
}

Related

  1. toMap(Properties properties)
  2. toMap(Properties properties)
  3. toMap(Properties props)
  4. toMap(Properties props)
  5. toMap(Properties props)
  6. toMap(Properties props, String prefix)
  7. toMap(Properties sourceProperties)