@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"))
.create(); final Project p = Project.builder().withId(new Id("2")) .withBudget(new Money(10500, "EUR")) .withCustomer(c1) .withName("Project 1")
.withEvents(je1) .withHourlyRate(rate1) .withBudget(new Money(123456, "EUR")) .create(); final Project acmeConsultingProject2 = .withEvents(je2) .withHourlyRate(rate2) .withBudget(new Money(234567, "EUR")) .create(); final Project acmeFinancingProject1 = .withHourlyRate(rate3) .withEvents(je3) .withBudget(new Money(345678, "EUR")) .create(); final Project acmeFinancingProject2 = .withHourlyRate(rate4) .withEvents(je4) .withBudget(new Money(456789, "EUR")) .create();