@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); } } }
.withName(projectConfig.getString("projectName")) .withStartDate(projectConfig.getDate("projectStartDate")) .withEndDate(projectConfig.getDate("projectDueDate")) .withNotes(projectConfig.getString("projectNotes"))
.withName("Project 1") .withDescription("description of project 1") .withStartDate(parseDate("2014-01-03")) .withEndDate(parseDate("2014-02-12")) .withNotes("Notes for project 1")
.withDescription("Acme Consulting Project 1") .withName("Acme Consulting Project 1") .withStartDate(project1StartDate) .withEndDate(project1EndDate) .withNumber("PRJ ACME-1") .withDescription("Acme Consulting Project 2") .withName("Acme Consulting Project 2") .withStartDate(project2StartDate) .withEndDate(project2EndDate) .withNumber("PRJ ACME-2") .withDescription("Acme Financing Project 1") .withName("Acme Financing Project 1") .withStartDate(project3StartDate) .withEndDate(project3EndDate) .withNumber("PRJ ACME-3") .withDescription("Acme Financing Project 2") .withName("Acme Financing Project 2") .withStartDate(project4StartDate) .withEndDate(project4EndDate) .withNumber("PRJ ACME-4")