@Test public void testPropertiesToConfiguration() { final Properties properties = new Properties(); final int entries = 10; for (int i = 0; i < entries; i++) { properties.setProperty("key" + i, "value" + i); } final Configuration configuration = ConfigurationUtils.createConfiguration(properties); for (String key : properties.stringPropertyNames()) { assertThat(configuration.getString(key, ""), is(equalTo(properties.getProperty(key)))); } assertThat(configuration.toMap().size(), is(properties.size())); }
@Nonnull public static Configuration createConfiguration(Properties properties) { final Configuration configuration = new Configuration(); final Set<String> propertyNames = properties.stringPropertyNames(); for (String propertyName : propertyNames) { configuration.setString(propertyName, properties.getProperty(propertyName)); } return configuration; }
ConfigurationUtils { @Nonnull public static Configuration createConfiguration(Properties properties) { final Configuration configuration = new Configuration(); final Set<String> propertyNames = properties.stringPropertyNames(); for (String propertyName : propertyNames) { configuration.setString(propertyName, properties.getProperty(propertyName)); } return configuration; } }
ConfigurationUtils { @Nonnull public static Configuration createConfiguration(Properties properties) { final Configuration configuration = new Configuration(); final Set<String> propertyNames = properties.stringPropertyNames(); for (String propertyName : propertyNames) { configuration.setString(propertyName, properties.getProperty(propertyName)); } return configuration; } private  ConfigurationUtils(); }
ConfigurationUtils { @Nonnull public static Configuration createConfiguration(Properties properties) { final Configuration configuration = new Configuration(); final Set<String> propertyNames = properties.stringPropertyNames(); for (String propertyName : propertyNames) { configuration.setString(propertyName, properties.getProperty(propertyName)); } return configuration; } private  ConfigurationUtils(); static MemorySize getJobManagerHeapMemory(Configuration configuration); static MemorySize getTaskManagerHeapMemory(Configuration configuration); static Optional<Time> getSystemResourceMetricsProbingInterval(Configuration configuration); @Nonnull static String[] parseTempDirectories(Configuration configuration); @Nonnull static String[] parseLocalStateDirectories(Configuration configuration); @Nonnull static Configuration createConfiguration(Properties properties); }
ConfigurationUtils { @Nonnull public static Configuration createConfiguration(Properties properties) { final Configuration configuration = new Configuration(); final Set<String> propertyNames = properties.stringPropertyNames(); for (String propertyName : propertyNames) { configuration.setString(propertyName, properties.getProperty(propertyName)); } return configuration; } private  ConfigurationUtils(); static MemorySize getJobManagerHeapMemory(Configuration configuration); static MemorySize getTaskManagerHeapMemory(Configuration configuration); static Optional<Time> getSystemResourceMetricsProbingInterval(Configuration configuration); @Nonnull static String[] parseTempDirectories(Configuration configuration); @Nonnull static String[] parseLocalStateDirectories(Configuration configuration); @Nonnull static Configuration createConfiguration(Properties properties);  }