Subversion Repositories SmartDukaan

Rev

Rev 26821 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26821 Rev 35030
Line 175... Line 175...
175
				return false;
175
				return false;
176
		} else if (!state.equals(other.state))
176
		} else if (!state.equals(other.state))
177
			return false;
177
			return false;
178
		return true;
178
		return true;
179
	}
179
	}
-
 
180
 
-
 
181
 
-
 
182
	public String getAddressString() {
-
 
183
		StringBuilder sb = new StringBuilder();
-
 
184
 
-
 
185
		if (line1 != null && !line1.isEmpty()) {
-
 
186
			sb.append(line1).append(", ");
-
 
187
		}
-
 
188
		if (line2 != null && !line2.isEmpty()) {
-
 
189
			sb.append(line2).append(", ");
-
 
190
		}
-
 
191
		if (landmark != null && !landmark.isEmpty()) {
-
 
192
			sb.append("Landmark: ").append(landmark).append(", ");
-
 
193
		}
-
 
194
		if (city != null && !city.isEmpty()) {
-
 
195
			sb.append(city).append(", ");
-
 
196
		}
-
 
197
		if (state != null && !state.isEmpty()) {
-
 
198
			sb.append(state).append(", ");
-
 
199
		}
-
 
200
		if (pinCode != null && !pinCode.isEmpty()) {
-
 
201
			sb.append("PIN-").append(pinCode).append(", ");
-
 
202
		}
-
 
203
		if (country != null && !country.isEmpty()) {
-
 
204
			sb.append(country).append(", ");
-
 
205
		}
-
 
206
		if (phoneNumber != null && !phoneNumber.isEmpty()) {
-
 
207
			sb.append("Ph: ").append(phoneNumber);
-
 
208
		}
-
 
209
 
-
 
210
		// remove trailing comma/space
-
 
211
		String result = sb.toString().trim();
-
 
212
		if (result.endsWith(",")) {
-
 
213
			result = result.substring(0, result.length() - 1).trim();
-
 
214
		}
-
 
215
		return result;
-
 
216
	}
180
	@Override
217
	@Override
181
	public String toString() {
218
	public String toString() {
182
		return "CustomAddress [id=" + id + ", name=" + name + ", lastName=" + lastName + ", line1=" + line1 + ", line2="
219
		return "CustomAddress [id=" + id + ", name=" + name + ", lastName=" + lastName + ", line1=" + line1 + ", line2="
183
				+ line2 + ", landmark=" + landmark + ", city=" + city + ", state=" + state + ", pinCode=" + pinCode
220
				+ line2 + ", landmark=" + landmark + ", city=" + city + ", state=" + state + ", pinCode=" + pinCode
184
				+ ", country=" + country + ", phoneNumber=" + phoneNumber + "]";
221
				+ ", country=" + country + ", phoneNumber=" + phoneNumber + "]";