Skip to content

Instantly share code, notes, and snippets.

@danhyun
Created September 22, 2014 21:52
Show Gist options
  • Save danhyun/2f044acf26ad0cb51d34 to your computer and use it in GitHub Desktop.
Save danhyun/2f044acf26ad0cb51d34 to your computer and use it in GitHub Desktop.
public String getPrettyAddress() {
String prettyAddress = null;
if (this.getAddresses() != null && !this.getAddresses().isEmpty()) {
Address mainAddress = null;
if (this.getAddresses().get(BusinessAddressType.PRIMARY.getType()) != null) {
mainAddress = this.getAddresses().get(BusinessAddressType.PRIMARY.getType()).getAddress();
} else if (this.getAddresses().get(BusinessAddressType.SHIPPING.getType().toLowerCase()) != null) {
mainAddress = this.getAddresses().get(BusinessAddressType.SHIPPING.getType().toLowerCase()).getAddress();
}
}
return prettyAddress;
}
@Veedrac
Copy link

Veedrac commented Sep 23, 2014

I think it's very enterprise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment