Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

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

public class Main {
    public static Map<String, String> propertiesAsMap(Properties properties) {

        Set<Entry<Object, Object>> entries = properties.entrySet();

        Map<String, String> responseMap = new HashMap<String, String>();

        for (Entry<Object, Object> entry : entries) {
            responseMap.put((String) entry.getKey(), (String) entry.getValue());
        }

        return responseMap;

    }
}