Convert wikidata/mwapi to kotlin (part 3) (#6004)

* Convert Edit to kotlin along with deleting unused class

* Converted ExtMetadata to kotlin

* Convert ImageInfo to kotlin

* Removed unused class

* Convert Notification to kotlin

* Convert PageProperties to kotlin

* Convert PageTitle to kotlin

* Convert Namespace to kotlin
This commit is contained in:
Paul Hawke 2024-12-06 21:20:06 -06:00 committed by GitHub
parent 64354fb9e4
commit 015c5d5c63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 832 additions and 1133 deletions

View file

@ -41,6 +41,13 @@ data class LatLng(
* Accepts a non-null [Location] and converts it to a [LatLng].
*/
companion object {
fun latLongOrNull(latitude: String?, longitude: String?): LatLng? =
if (!latitude.isNullOrBlank() && !longitude.isNullOrBlank()) {
LatLng(latitude.toDouble(), longitude.toDouble(), 0.0f)
} else {
null
}
/**
* gets the latitude and longitude of a given non-null location
* @param location the non-null location of the user