Skip to content

Instantly share code, notes, and snippets.

@dev-aritra
Created November 16, 2020 11:02
Show Gist options
  • Save dev-aritra/d74ce86b2d615a94dbfd157b6045ec1e to your computer and use it in GitHub Desktop.
Save dev-aritra/d74ce86b2d615a94dbfd157b6045ec1e to your computer and use it in GitHub Desktop.
public class Location {
private final String zipCode;
private final Double latitude;
private final Double longitude;
public Location(String zipCode, Double latitude, Double longitude) {
this.zipCode = zipCode;
this.latitude = latitude;
this.longitude = longitude;
}
boolean isValid() {
// Some validation logic
return true;
}
public String getZipCode() {
return zipCode;
}
public Double getLatitude() {
return latitude;
}
public Double getLongitude() {
return longitude;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment