@Test public void testNewBuilder() { ConfigBasedPipelineBuilder builder = PipelineFactory.newBuilder(); for (int i = 0; i < CONFIG_COUNT; i++) { builder.addConfigStage(mockConfigStageName(i), configs.get(i)); } ConfigBasedPipeline result = builder.buildAs(PIPELINE_NAME); assertPipelineIsTheExpected(result); }
public static ConfigBasedPipelineBuilder newBuilder() { return new ConfigBasedPipelineBuilder() { private final List<PipelineConfigStage> configStages = new ArrayList<>(); @Override public ConfigBasedPipelineBuilder addConfigStage(final String name, final Config config) { configStages.add(new PipelineConfigStage(name, config)); return this; } @Override public ConfigBasedPipelineBuilder addConfigStage(final PipelineConfigStage configStage) { configStages.add(configStage); return this; } @Override public ConfigBasedPipeline buildAs(String name) { return new ConfigBasedPipelineImpl(new PipelineConfigImpl(name, configStages)); } }; }
PipelineFactory { public static ConfigBasedPipelineBuilder newBuilder() { return new ConfigBasedPipelineBuilder() { private final List<PipelineConfigStage> configStages = new ArrayList<>(); @Override public ConfigBasedPipelineBuilder addConfigStage(final String name, final Config config) { configStages.add(new PipelineConfigStage(name, config)); return this; } @Override public ConfigBasedPipelineBuilder addConfigStage(final PipelineConfigStage configStage) { configStages.add(configStage); return this; } @Override public ConfigBasedPipeline buildAs(String name) { return new ConfigBasedPipelineImpl(new PipelineConfigImpl(name, configStages)); } }; } }
PipelineFactory { public static ConfigBasedPipelineBuilder newBuilder() { return new ConfigBasedPipelineBuilder() { private final List<PipelineConfigStage> configStages = new ArrayList<>(); @Override public ConfigBasedPipelineBuilder addConfigStage(final String name, final Config config) { configStages.add(new PipelineConfigStage(name, config)); return this; } @Override public ConfigBasedPipelineBuilder addConfigStage(final PipelineConfigStage configStage) { configStages.add(configStage); return this; } @Override public ConfigBasedPipeline buildAs(String name) { return new ConfigBasedPipelineImpl(new PipelineConfigImpl(name, configStages)); } }; } private  PipelineFactory(); }
PipelineFactory { public static ConfigBasedPipelineBuilder newBuilder() { return new ConfigBasedPipelineBuilder() { private final List<PipelineConfigStage> configStages = new ArrayList<>(); @Override public ConfigBasedPipelineBuilder addConfigStage(final String name, final Config config) { configStages.add(new PipelineConfigStage(name, config)); return this; } @Override public ConfigBasedPipelineBuilder addConfigStage(final PipelineConfigStage configStage) { configStages.add(configStage); return this; } @Override public ConfigBasedPipeline buildAs(String name) { return new ConfigBasedPipelineImpl(new PipelineConfigImpl(name, configStages)); } }; } private  PipelineFactory(); static ConfigBasedPipelineBuilder newBuilder(); static ConfigBasedPipeline newPipeline(final PipelineConfig pipelineConfig); }
PipelineFactory { public static ConfigBasedPipelineBuilder newBuilder() { return new ConfigBasedPipelineBuilder() { private final List<PipelineConfigStage> configStages = new ArrayList<>(); @Override public ConfigBasedPipelineBuilder addConfigStage(final String name, final Config config) { configStages.add(new PipelineConfigStage(name, config)); return this; } @Override public ConfigBasedPipelineBuilder addConfigStage(final PipelineConfigStage configStage) { configStages.add(configStage); return this; } @Override public ConfigBasedPipeline buildAs(String name) { return new ConfigBasedPipelineImpl(new PipelineConfigImpl(name, configStages)); } }; } private  PipelineFactory(); static ConfigBasedPipelineBuilder newBuilder(); static ConfigBasedPipeline newPipeline(final PipelineConfig pipelineConfig);  }