@Test(expectedExceptions = IllegalArgumentException.class) public void testNullModuleIdBuild() { new ModuleBuilder().build(); }
public Module build() { if (id == null || id.trim().length() == 0) { throw new IllegalArgumentException("Cannot build module entity without Module ID value"); } Module module = new Module(); module.setId(id.trim()); module.setArtifacts(artifacts); module.setDependencies(dependencies); module.setProperties(properties); module.setExcludedArtifacts(excludedArtifacts); return module; }
ModuleBuilder { public Module build() { if (id == null || id.trim().length() == 0) { throw new IllegalArgumentException("Cannot build module entity without Module ID value"); } Module module = new Module(); module.setId(id.trim()); module.setArtifacts(artifacts); module.setDependencies(dependencies); module.setProperties(properties); module.setExcludedArtifacts(excludedArtifacts); return module; } }
ModuleBuilder { public Module build() { if (id == null || id.trim().length() == 0) { throw new IllegalArgumentException("Cannot build module entity without Module ID value"); } Module module = new Module(); module.setId(id.trim()); module.setArtifacts(artifacts); module.setDependencies(dependencies); module.setProperties(properties); module.setExcludedArtifacts(excludedArtifacts); return module; }  }
ModuleBuilder { public Module build() { if (id == null || id.trim().length() == 0) { throw new IllegalArgumentException("Cannot build module entity without Module ID value"); } Module module = new Module(); module.setId(id.trim()); module.setArtifacts(artifacts); module.setDependencies(dependencies); module.setProperties(properties); module.setExcludedArtifacts(excludedArtifacts); return module; }  Module build(); ModuleBuilder id(String id); ModuleBuilder artifacts(List<Artifact> artifacts); ModuleBuilder excludedArtifacts(List<Artifact> excludedArtifacts); ModuleBuilder addArtifact(Artifact artifact); ModuleBuilder addExcludedArtifact(Artifact artifact); ModuleBuilder dependencies(List<Dependency> dependencies); ModuleBuilder addDependency(Dependency dependency); ModuleBuilder properties(Properties properties); ModuleBuilder addProperty(Object key, Object value); }
ModuleBuilder { public Module build() { if (id == null || id.trim().length() == 0) { throw new IllegalArgumentException("Cannot build module entity without Module ID value"); } Module module = new Module(); module.setId(id.trim()); module.setArtifacts(artifacts); module.setDependencies(dependencies); module.setProperties(properties); module.setExcludedArtifacts(excludedArtifacts); return module; }  Module build(); ModuleBuilder id(String id); ModuleBuilder artifacts(List<Artifact> artifacts); ModuleBuilder excludedArtifacts(List<Artifact> excludedArtifacts); ModuleBuilder addArtifact(Artifact artifact); ModuleBuilder addExcludedArtifact(Artifact artifact); ModuleBuilder dependencies(List<Dependency> dependencies); ModuleBuilder addDependency(Dependency dependency); ModuleBuilder properties(Properties properties); ModuleBuilder addProperty(Object key, Object value);  }