public S initialize(DeepJobConfig deepJobConfig){ if(deepJobConfig instanceof DeepJobConfig) { this.catalog = deepJobConfig.getCatalog(); this.table = deepJobConfig.getTable(); this.username = deepJobConfig.getUsername(); this.password = deepJobConfig.getPassword(); this.filters = deepJobConfig.getFilters(); this.inputColumns = deepJobConfig.getInputColumns(); this.port = deepJobConfig.getPort(); this.host = deepJobConfig.getHostList(); this.extractorImplClass = deepJobConfig.getExtractorImplClass(); this.extractorImplClassName = deepJobConfig.getExtractorImplClassName(); this.entityClass = deepJobConfig.getEntityClass(); }else{ return (S) deepJobConfig.initialize(); } return (S) this.initialize(); }
public S initialize(DeepJobConfig deepJobConfig){ if(deepJobConfig instanceof DeepJobConfig) { this.catalog = deepJobConfig.getCatalog(); this.table = deepJobConfig.getTable(); this.username = deepJobConfig.getUsername(); this.password = deepJobConfig.getPassword(); this.filters = deepJobConfig.getFilters(); this.inputColumns = deepJobConfig.getInputColumns(); this.port = deepJobConfig.getPort(); this.host = deepJobConfig.getHostList(); this.extractorImplClass = deepJobConfig.getExtractorImplClass(); this.extractorImplClassName = deepJobConfig.getExtractorImplClassName(); this.entityClass = deepJobConfig.getEntityClass(); }else{ return (S) deepJobConfig.initialize(); } return (S) this.initialize(); }
@Test public void initConfigTest(){ ExtractorConfig extractorConfig = new ExtractorConfig(); extractorConfig.setExtractorImplClassName("testExtractor"); DeepJobConfig deepJobConfig = new DeepJobConfig(); deepJobConfig.setExtractorImplClassName("testDeepJobConfig"); ChildDeepJobConfig childDeepJobConfig = new ChildDeepJobConfig(); childDeepJobConfig.setExtractorImplClassName("testChildDeepJobConfig"); childDeepJobConfig.setTestFiled("testField"); ChildDeepJobConfig test = initConfig(extractorConfig, new ChildDeepJobConfig()); assertEquals(test.getExtractorImplClassName(), extractorConfig.getExtractorImplClassName()); assertNull(test.getTestFiled()); test = initConfig(deepJobConfig, new ChildDeepJobConfig()); assertEquals(test.getExtractorImplClassName(), deepJobConfig.getExtractorImplClassName()); assertNull(test.getTestFiled()); test = initConfig(childDeepJobConfig, new ChildDeepJobConfig()); assertEquals(test.getExtractorImplClassName(), childDeepJobConfig.getExtractorImplClassName()); assertEquals(test.getTestFiled(), childDeepJobConfig.getTestFiled()); }