/** * Sets the geo location based on the passed in lat and lon values. Both * must be null or non null, and the lat must be between -90 and 90, and the * lon between -180 and 180. */ public void setGeoLocation(Double lat, Double lon) { if (lat != null && lon != null) { setExtension(new GeoLat(lat)); setExtension(new GeoLong(lon)); } else if (lat != null || lon != null) { throw new IllegalArgumentException( "'lat' and 'lon' must either both be null or non-null."); } else { removeExtension(GeoLat.class); removeExtension(GeoLong.class); } }
/** * Sets the geo location based on the passed in lat and lon values. Both * must be null or non null, and the lat must be between -90 and 90, and the * lon between -180 and 180. */ public void setGeoLocation(Double lat, Double lon) { if (lat != null && lon != null) { setExtension(new GeoLat(lat)); setExtension(new GeoLong(lon)); } else if (lat != null || lon != null) { throw new IllegalArgumentException( "'lat' and 'lon' must either both be null or non-null."); } else { removeExtension(GeoLat.class); removeExtension(GeoLong.class); } }
/** * Sets the geo location based on the passed in lat and lon values. Both * must be null or non null, and the lat must be between -90 and 90, and the * lon between -180 and 180. */ public void setGeoLocation(Double lat, Double lon) { if (lat != null && lon != null) { setExtension(new GeoLat(lat)); setExtension(new GeoLong(lon)); } else if (lat != null || lon != null) { throw new IllegalArgumentException( "'lat' and 'lon' must either both be null or non-null."); } else { removeExtension(GeoLat.class); removeExtension(GeoLong.class); } }