@Test public void testAddress() { assertEquals(m_expectedAddress, m_geolocation.asAddressString()); }
public String asAddressString() { final StringBuffer sb = new StringBuffer(); if (hasText(this.getAddress1())) { sb.append(this.getAddress1()); if (hasText(this.getAddress2())) { sb.append(" ").append(this.getAddress2()); } } if (hasText(this.getCity())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getCity()); } if (hasText(this.getState())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getState()); } if (hasText(this.getZip())) { if (hasText(this.getState())) { sb.append(" "); } else if (sb.length() > 0) { sb.append(", "); } sb.append(this.getZip()); } if (hasText(this.getCountry())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getCountry()); } if (sb.length() == 0) { return null; } return sb.toString(); }
OnmsGeolocation implements Serializable { public String asAddressString() { final StringBuffer sb = new StringBuffer(); if (hasText(this.getAddress1())) { sb.append(this.getAddress1()); if (hasText(this.getAddress2())) { sb.append(" ").append(this.getAddress2()); } } if (hasText(this.getCity())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getCity()); } if (hasText(this.getState())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getState()); } if (hasText(this.getZip())) { if (hasText(this.getState())) { sb.append(" "); } else if (sb.length() > 0) { sb.append(", "); } sb.append(this.getZip()); } if (hasText(this.getCountry())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getCountry()); } if (sb.length() == 0) { return null; } return sb.toString(); } }
OnmsGeolocation implements Serializable { public String asAddressString() { final StringBuffer sb = new StringBuffer(); if (hasText(this.getAddress1())) { sb.append(this.getAddress1()); if (hasText(this.getAddress2())) { sb.append(" ").append(this.getAddress2()); } } if (hasText(this.getCity())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getCity()); } if (hasText(this.getState())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getState()); } if (hasText(this.getZip())) { if (hasText(this.getState())) { sb.append(" "); } else if (sb.length() > 0) { sb.append(", "); } sb.append(this.getZip()); } if (hasText(this.getCountry())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getCountry()); } if (sb.length() == 0) { return null; } return sb.toString(); } OnmsGeolocation(); }
OnmsGeolocation implements Serializable { public String asAddressString() { final StringBuffer sb = new StringBuffer(); if (hasText(this.getAddress1())) { sb.append(this.getAddress1()); if (hasText(this.getAddress2())) { sb.append(" ").append(this.getAddress2()); } } if (hasText(this.getCity())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getCity()); } if (hasText(this.getState())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getState()); } if (hasText(this.getZip())) { if (hasText(this.getState())) { sb.append(" "); } else if (sb.length() > 0) { sb.append(", "); } sb.append(this.getZip()); } if (hasText(this.getCountry())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getCountry()); } if (sb.length() == 0) { return null; } return sb.toString(); } OnmsGeolocation(); @Column(name="address1", length=256) String getAddress1(); void setAddress1(String address1); @Column(name="address2", length=256) String getAddress2(); void setAddress2(String address2); @Column(name="city", length=64) String getCity(); void setCity(String city); @Column(name="state", length=64) String getState(); void setState(String state); @Column(name="zip", length=64) String getZip(); void setZip(String zip); @Column(name="country", length=64) String getCountry(); void setCountry(String country); @Column(name="longitude") Float getLongitude(); void setLongitude(final Float longitude); @Column(name="latitude") Float getLatitude(); void setLatitude(final Float latitude); @Override String toString(); String asAddressString(); void mergeGeolocation(final OnmsGeolocation from); }
OnmsGeolocation implements Serializable { public String asAddressString() { final StringBuffer sb = new StringBuffer(); if (hasText(this.getAddress1())) { sb.append(this.getAddress1()); if (hasText(this.getAddress2())) { sb.append(" ").append(this.getAddress2()); } } if (hasText(this.getCity())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getCity()); } if (hasText(this.getState())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getState()); } if (hasText(this.getZip())) { if (hasText(this.getState())) { sb.append(" "); } else if (sb.length() > 0) { sb.append(", "); } sb.append(this.getZip()); } if (hasText(this.getCountry())) { if (sb.length() > 0) sb.append(", "); sb.append(this.getCountry()); } if (sb.length() == 0) { return null; } return sb.toString(); } OnmsGeolocation(); @Column(name="address1", length=256) String getAddress1(); void setAddress1(String address1); @Column(name="address2", length=256) String getAddress2(); void setAddress2(String address2); @Column(name="city", length=64) String getCity(); void setCity(String city); @Column(name="state", length=64) String getState(); void setState(String state); @Column(name="zip", length=64) String getZip(); void setZip(String zip); @Column(name="country", length=64) String getCountry(); void setCountry(String country); @Column(name="longitude") Float getLongitude(); void setLongitude(final Float longitude); @Column(name="latitude") Float getLatitude(); void setLatitude(final Float latitude); @Override String toString(); String asAddressString(); void mergeGeolocation(final OnmsGeolocation from);  }