Here you can find the source of toMap(final Properties properties)
Parameter | Description |
---|---|
properties | Properties |
public static Map<String, String> toMap(final Properties properties)
//package com.java2s; /*/*from w ww . j a v a2 s . c om*/ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. // You must accept the terms of that agreement to use this software. // // Copyright (C) 2001-2005 Julian Hyde // Copyright (C) 2005-2012 Pentaho and others // All Rights Reserved. */ import java.util.*; public class Main { /** * Converts a {@link Properties} object to a string-to-string {@link Map}. * * @param properties Properties * @return String-to-string map */ public static Map<String, String> toMap(final Properties properties) { return new AbstractMap<String, String>() { @SuppressWarnings({ "unchecked" }) public Set<Entry<String, String>> entrySet() { return (Set) properties.entrySet(); } }; } }