![JAR search and dependency download from the Maven repository](/logo.png)
commonMain.aws.sdk.kotlin.services.devicefarm.model.Location.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.devicefarm.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Represents a latitude and longitude pair, expressed in geographic coordinate system degrees (for example, 47.6204, -122.3491).
*
* Elevation is currently not supported.
*/
public class Location private constructor(builder: Builder) {
/**
* The latitude.
*/
public val latitude: kotlin.Double = requireNotNull(builder.latitude) { "A non-null value must be provided for latitude" }
/**
* The longitude.
*/
public val longitude: kotlin.Double = requireNotNull(builder.longitude) { "A non-null value must be provided for longitude" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.devicefarm.model.Location = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Location(")
append("latitude=$latitude,")
append("longitude=$longitude")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = latitude.hashCode()
result = 31 * result + (longitude.hashCode())
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as Location
if (!(latitude?.equals(other.latitude) ?: (other.latitude == null))) return false
if (!(longitude?.equals(other.longitude) ?: (other.longitude == null))) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.devicefarm.model.Location = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The latitude.
*/
public var latitude: kotlin.Double? = null
/**
* The longitude.
*/
public var longitude: kotlin.Double? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.devicefarm.model.Location) : this() {
this.latitude = x.latitude
this.longitude = x.longitude
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.devicefarm.model.Location = Location(this)
internal fun correctErrors(): Builder {
if (latitude == null) latitude = 0.0
if (longitude == null) longitude = 0.0
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy