/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<ServiceConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, ServiceConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<DurableLogConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, DurableLogConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<AttributeIndexConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, AttributeIndexConfig::new); } //endregion
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<ReadIndexConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, ReadIndexConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<HDFSStorageConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, HDFSStorageConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<ContainerConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, ContainerConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ static ConfigBuilder<TestConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, TestConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<BookKeeperConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, BookKeeperConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<FileSystemStorageConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, FileSystemStorageConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<WriterConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, WriterConfig::new); }
/** * Creates a new instance of the ConfigBuilder class that uses the given java.util.Properties object as a base. * This method does not touch the current instance. * * @param properties A java.util.Properties object to wrap. * @return A new instance of the ConfigBuilder class with the same arguments as the current one, except that it uses * the given Properties object. */ public ConfigBuilder<T> rebase(Properties properties) { return new ConfigBuilder<>(this.namespace, properties, this.constructor); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<MetricsConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, MetricsConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<SingleNodeConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, SingleNodeConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<ExtendedS3StorageConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, ExtendedS3StorageConfig::new); }
/** * Creates a new ConfigBuilder that can be used to create instances of this class. * * @return A new Builder for this class. */ public static ConfigBuilder<RocksDBConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, RocksDBConfig::new); }
public static ConfigBuilder<AutoScalerConfig> builder() { return new ConfigBuilder<>(COMPONENT_CODE, AutoScalerConfig::new); } }
/** * Tests the copyTo() method. */ @Test public void testCopyTo() { final String namespace = "ns"; final int propertyCount = 10; val builder = new ConfigBuilder<TestConfig>(namespace, TestConfig::new); for (int i = 0; i < propertyCount; i++) { builder.with(Property.named(Integer.toString(i)), i); } Properties p2 = new Properties(); p2.setProperty(namespace + ".1", "a"); // Decoy - this should be overridden. builder.copyTo(p2); Assert.assertEquals("Unexpected number of properties copied.", propertyCount, p2.size()); for (int i = 0; i < propertyCount; i++) { val actualProp2 = p2.getProperty(namespace + "." + Integer.toString(i)); Assert.assertEquals("CopyTo did not set the correct values.", Integer.toString(i), actualProp2); } }
/** * Tests the with() method. */ @Test public void testWith() { final String namespace = "ns"; final int propertyCount = 10; val builder = new ConfigBuilder<TestConfig>(namespace, TestConfig::new); for (int i = 0; i < propertyCount; i++) { val result = builder.with(Property.named(Integer.toString(i)), i); Assert.assertEquals("with() did not return this instance.", builder, result); } TestConfig c = builder.build(); for (int i = 0; i < propertyCount; i++) { val p = Property.<Integer>named(Integer.toString(i)); val actual = c.getProperties().getInt(p); Assert.assertEquals("Unexpected value in result.", i, actual); } }
final String namespace = "ns"; final int propertyCount = 10; val builder1 = new ConfigBuilder<TestConfig>(namespace, TestConfig::new); for (int i = 0; i < propertyCount; i++) { builder1.with(Property.named(Integer.toString(i)), i);