Code example for Address

Methods: getAdminArea, getFeatureName, getLocality, getPostalCode, getThoroughfare, hasLatitude, hasLongitude

0
		return PoolAddress.toString(PoolAddress.setLines(a)).equals(
				PoolAddress.toString(PoolAddress.setLines(b)));
	} 
 
	public static boolean isComplete(Address a) {
		return a != null && (a.getFeatureName() != null && a.getThoroughfare() != null
				&& a.getLocality() != null && a.getAdminArea() != null
				&& a.getPostalCode() != null);
	} 
 
	public static boolean isGeocoded(Address a) {
		return (PoolAddress.isComplete(a) && a.hasLatitude() && a.hasLongitude());
	} 
 
	public static String toString(Address a) {
		return String.format("%1$s%2$s%3$s",
				(a.getMaxAddressLineIndex() >= 0) ? a.getAddressLine(0) : "",
				(a.getMaxAddressLineIndex() >= 1) ? "\n"+a.getAddressLine(1) : "",
				(a.getMaxAddressLineIndex() >= 2) ? "\n"+a.getAddressLine(2) : "");
	}