@Nonnull public Project.Builder toBuilder (final @Nonnull Accounting accounting) { try { final Customer customer = accounting.getCustomerRegistry().findCustomers().withId(customerXml.getId()).result(); return new Project.Builder().withId(id) .withCustomer(customer) .withName(name) .withNumber(number) .withDescription(description) .withNotes(notes) .withStatus(status) .withHourlyRate(hourlyRate) .withBudget(budget) .withStartDate(startDate) .withEndDate(endDate) .withEvents(JobEventXml.toJobEvents(jobEventsXml)); } catch (NotFoundException e) { throw new RuntimeException(e); } } }
projectRegistry.addProject().withId(projectConfig.getId("uniqueIdentifier")) .withBudget(projectConfig.getMoney("projectEstimate")) .withCustomer(customer) .withName(projectConfig.getString("projectName"))
final Project p = Project.builder().withId(new Id("2")) .withBudget(new Money(10500, "EUR")) .withCustomer(c1) .withName("Project 1") .withDescription("description of project 1")
projectRegistry.addProject() .withId(new Id("" + nextId++)) .withCustomer(acmeConsulting) .withDescription("Acme Consulting Project 1") .withName("Acme Consulting Project 1") projectRegistry.addProject() .withId(new Id("" + nextId++)) .withCustomer(acmeConsulting) .withDescription("Acme Consulting Project 2") .withName("Acme Consulting Project 2") projectRegistry.addProject() .withId(new Id("" + nextId++)) .withCustomer(acmeFinancing) .withDescription("Acme Financing Project 1") .withName("Acme Financing Project 1") projectRegistry.addProject() .withId(new Id("" + nextId++)) .withCustomer(acmeFinancing) .withDescription("Acme Financing Project 2") .withName("Acme Financing Project 2")