Creates an ImmutableMap from a Properties instance. Properties normally derive from Map , but they typically contain strings, which is awkward. This method lets you get a plain-old-Map out of a Properties. @param properties a {@
(Properties properties)
| 1299 | */ |
| 1300 | |
| 1301 | @GwtIncompatible // java.util.Properties |
| 1302 | public static ImmutableMap<String, String> fromProperties(Properties properties) { |
| 1303 | ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); |
| 1304 | for (Enumeration<?> e = properties.propertyNames(); e.hasMoreElements(); ) { |
| 1305 | String key = (String) e.nextElement(); |
| 1306 | builder.put(key, properties.getProperty(key)); |
| 1307 | } |
| 1308 | return builder.build(); |
| 1309 | } |
| 1310 | |
| 1311 | /** |
| 1312 | * Returns an immutable map entry with the specified key and value. The {@link |
nothing calls this directly
no test coverage detected