public Address toAddress() { Address address = new Address(); if (this.iso2Country != null && this.iso2Country.getValue() != null) { Country country = new Country(); country.setValue(Iso3166Country.fromValue(this.iso2Country.getValue().value())); address.setCountry(country); } if (this.visibility != null && this.visibility.getVisibility() != null) { address.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(this.getVisibility().getVisibility().value())); } if (!PojoUtil.isEmpty(this.getPutCode())) { address.setPutCode(Long.valueOf(this.getPutCode())); } if (displayIndex != null) { address.setDisplayIndex(displayIndex); } else { address.setDisplayIndex(0L); } address.setSource(new Source(source)); return address; }