commonMain.io.realm.kotlin.internal.geo.UnmanagedGeoCircle.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of library-base-jvm Show documentation
Show all versions of library-base-jvm Show documentation
Library code for Realm Kotlin. This artifact is not supposed to be consumed directly, but through 'io.realm.kotlin:gradle-plugin:1.11.1' instead.
package io.realm.kotlin.internal.geo
import io.realm.kotlin.annotations.ExperimentalGeoSpatialApi
import io.realm.kotlin.types.geo.Distance
import io.realm.kotlin.types.geo.GeoCircle
import io.realm.kotlin.types.geo.GeoPoint
@OptIn(ExperimentalGeoSpatialApi::class)
public data class UnmanagedGeoCircle(
public override val center: GeoPoint,
public override val radius: Distance
) : GeoCircle {
init {
if (radius.inRadians < 0) {
// Currently `Distance` does not allow negative values, but since a UDouble doesn't
// exists, we also validate the input here, just in case.
throw IllegalArgumentException("A negative radius is not allowed: $radius")
}
}
override fun toString(): String {
return "geoCircle([${center.longitude}, ${center.latitude}], ${radius.inRadians})"
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy