@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); } } }
.withBudget(projectConfig.getMoney("projectEstimate")) .withCustomer(customer) .withName(projectConfig.getString("projectName"))
.withBudget(new Money(10500, "EUR")) .withCustomer(c1) .withName("Project 1") .withDescription("description of project 1") .withStartDate(parseDate("2014-01-03"))
.withCustomer(acmeConsulting) .withDescription("Acme Consulting Project 1") .withName("Acme Consulting Project 1") .withStartDate(project1StartDate) .withEndDate(project1EndDate) .withCustomer(acmeConsulting) .withDescription("Acme Consulting Project 2") .withName("Acme Consulting Project 2") .withStartDate(project2StartDate) .withEndDate(project2EndDate) .withCustomer(acmeFinancing) .withDescription("Acme Financing Project 1") .withName("Acme Financing Project 1") .withStartDate(project3StartDate) .withEndDate(project3EndDate) .withCustomer(acmeFinancing) .withDescription("Acme Financing Project 2") .withName("Acme Financing Project 2") .withStartDate(project4StartDate) .withEndDate(project4EndDate)