setDislocatedFromPermanentResidence(Boolean.FALSE);
}
public static ResidenceInformationForm createFromPerson(final Person person) {
if (person.hasDefaultPhysicalAddress()) {
final PhysicalAddress physicalAddress = person.getDefaultPhysicalAddress();
final Country country = getCountryOfResidenceFromPhysicalAddress(physicalAddress);
final District districtOfResidence =
physicalAddress.getDistrictOfResidence() != null ? District.readByName(physicalAddress
.getDistrictOfResidence()) : null;
final DistrictSubdivision districtSubdivisionOfResidence;
if (districtOfResidence != null) {
districtSubdivisionOfResidence =
physicalAddress.getDistrictSubdivisionOfResidence() != null ? districtOfResidence
.getDistrictSubdivisionByName(physicalAddress.getDistrictSubdivisionOfResidence()) : null;
} else {
districtSubdivisionOfResidence = null;
}
return new ResidenceInformationForm(physicalAddress.getAddress(), physicalAddress.getAreaCode(),
physicalAddress.getAreaOfAreaCode(), physicalAddress.getArea(), physicalAddress.getParishOfResidence(),
districtOfResidence, districtSubdivisionOfResidence, country);
} else {
final ResidenceInformationForm residenceInformationForm = new ResidenceInformationForm();
residenceInformationForm.setCountryOfResidence(Country.readDefault());
return residenceInformationForm;