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)
| 1270 | * null |
| 1271 | */ |
| 1272 | @GwtIncompatible // java.util.Properties |
| 1273 | public static ImmutableMap<String, String> fromProperties(Properties properties) { |
| 1274 | ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); |
| 1275 | |
| 1276 | for (Enumeration<?> e = properties.propertyNames(); e.hasMoreElements(); ) { |
| 1277 | String key = (String) e.nextElement(); |
| 1278 | builder.put(key, properties.getProperty(key)); |
| 1279 | } |
| 1280 | |
| 1281 | return builder.build(); |
| 1282 | } |
| 1283 | |
| 1284 | /** |
| 1285 | * Returns an immutable map entry with the specified key and value. The {@link |
nothing calls this directly
no test coverage detected