Java Properties to Map toMap(Properties props)

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

Description

to Map

License

Apache License

Declaration

@SuppressWarnings("unchecked")
    public static <V> Map<String, V> toMap(Properties props) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.HashMap;

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

public class Main {
    @SuppressWarnings("unchecked")
    public static <V> Map<String, V> toMap(Properties props) {
        HashMap<String, V> result = new HashMap<>();
        for (String name : props.stringPropertyNames()) {
            result.put(name, (V) props.getProperty(name));
        }/*w  w w.j  a  v a2 s.c  o  m*/
        return result;
    }
}

Related

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