@Test public void testAsMap() { Map<String, String> map = asMap(createTestSample()); assertEquals(4, map.size()); assertEquals("a.value", map.get("a.key")); map = asMap(null); assertNotNull(map); assertEquals(0, map.size()); }
public static Map<String, String> asMap(Properties p) { Map<String, String> result = new HashMap<String, String>(); if (p == null) { return result; } for (String key : p.stringPropertyNames()) { result.put(key, p.getProperty(key)); } return result; }
PropertyHelper { public static Map<String, String> asMap(Properties p) { Map<String, String> result = new HashMap<String, String>(); if (p == null) { return result; } for (String key : p.stringPropertyNames()) { result.put(key, p.getProperty(key)); } return result; } }
PropertyHelper { public static Map<String, String> asMap(Properties p) { Map<String, String> result = new HashMap<String, String>(); if (p == null) { return result; } for (String key : p.stringPropertyNames()) { result.put(key, p.getProperty(key)); } return result; }  }
PropertyHelper { public static Map<String, String> asMap(Properties p) { Map<String, String> result = new HashMap<String, String>(); if (p == null) { return result; } for (String key : p.stringPropertyNames()) { result.put(key, p.getProperty(key)); } return result; }  static Properties getPropertySubset(Properties p, String prefix); static Properties getPropertySubset(Properties p, String prefix, boolean ignoreCase); static String getPropertyIgnoringCase(Properties p, String key, String defaultValue); static Map<String, String> asMap(Properties p); static String getPropertyIgnoringCase(Properties p, String key); static Properties loadQuietly(final File file); static Properties loadQuietly(final String resource); static Properties loadQuietly(final ClassLoader cl, final String resource); static Properties loadQuietly(final URL resource); static Properties loadQuietly(final InputStream in); static Properties loadQuietly(PropertyInputStream e); static Properties load(PropertyInputStream e); }
PropertyHelper { public static Map<String, String> asMap(Properties p) { Map<String, String> result = new HashMap<String, String>(); if (p == null) { return result; } for (String key : p.stringPropertyNames()) { result.put(key, p.getProperty(key)); } return result; }  static Properties getPropertySubset(Properties p, String prefix); static Properties getPropertySubset(Properties p, String prefix, boolean ignoreCase); static String getPropertyIgnoringCase(Properties p, String key, String defaultValue); static Map<String, String> asMap(Properties p); static String getPropertyIgnoringCase(Properties p, String key); static Properties loadQuietly(final File file); static Properties loadQuietly(final String resource); static Properties loadQuietly(final ClassLoader cl, final String resource); static Properties loadQuietly(final URL resource); static Properties loadQuietly(final InputStream in); static Properties loadQuietly(PropertyInputStream e); static Properties load(PropertyInputStream e);  }