String city = postalAddress.getCity();
String country = postalAddress.getCountry();
String code = postalAddress.getPostalCode();
String state = postalAddress.getStateOrProvince();
AddressLine stnumAL = objectFactory.createAddressLine();
stnumAL.setKeyName("STREET_NUMBER");
if (stnum != null) {
stnumAL.setKeyValue(stnum);
}
AddressLine stAL = objectFactory.createAddressLine();
stAL.setKeyName("STREET");
if (st != null) {
stAL.setKeyValue(st);
}
AddressLine cityAL = objectFactory.createAddressLine();
cityAL.setKeyName("CITY");
if (city != null) {
cityAL.setKeyValue(city);
}
AddressLine countryAL = objectFactory.createAddressLine();
countryAL.setKeyName("COUNTRY");
if (country != null) {
countryAL.setKeyValue(country);
}
AddressLine codeAL = objectFactory.createAddressLine();
codeAL.setKeyName("POSTALCODE");
if (code != null) {
codeAL.setKeyValue(code);
}
AddressLine stateAL = objectFactory.createAddressLine();
stateAL.setKeyName("STATE");
if (state != null) {
stateAL.setKeyValue(state);
}
// Add the AddressLine to vector
addarr[0] = stnumAL;
addarr[1] = stAL;