@Nullable public static ParcelableLocation fromGeoLocation(@Nullable GeoLocation geoLocation) { if (geoLocation == null) return null; final ParcelableLocation result = new ParcelableLocation(); result.latitude = geoLocation.getLatitude(); result.longitude = geoLocation.getLongitude(); return result; }
public ParcelableLocation(@Nullable final GeoLocation location) { latitude = location != null ? location.getLatitude() : Double.NaN; longitude = location != null ? location.getLongitude() : Double.NaN; }