public AgencyResultBuilder forPerson(String firstName, String lastName, String street, String postCode, String city) { if(this.personId != null) { throw new IllegalArgumentException("You have already set a person"); } this.personId = new PersonId.PersonIdBuilder(firstName, lastName) .city(city) .street(street) .postCode(postCode) .build(); return this; }
private ApplicantAggregate(ApplicantAggregateBuilder builder) { PersonId personId = new PersonId.PersonIdBuilder(builder.firstName, builder.lastName) .postCode(builder.postCode) .city(builder.city) .street(builder.street) .build(); Address address = new Address(builder.street, builder.postCode, builder.city); this.applicantRootEntity = new ApplicantRootEntity(personId, builder.applicationNumber, builder.firstName, builder.lastName, address, builder.accountBalance); }