
commonMain.aws.sdk.kotlin.services.groundstation.model.RangedSocketAddress.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.groundstation.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A socket address with a port range.
*/
public class RangedSocketAddress private constructor(builder: Builder) {
/**
* IPv4 socket address.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* Port range of a socket address.
*/
public val portRange: aws.sdk.kotlin.services.groundstation.model.IntegerRange? = builder.portRange
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.groundstation.model.RangedSocketAddress = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("RangedSocketAddress(")
append("name=$name,")
append("portRange=$portRange")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = name.hashCode()
result = 31 * result + (portRange?.hashCode() ?: 0)
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 RangedSocketAddress
if (name != other.name) return false
if (portRange != other.portRange) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.groundstation.model.RangedSocketAddress = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* IPv4 socket address.
*/
public var name: kotlin.String? = null
/**
* Port range of a socket address.
*/
public var portRange: aws.sdk.kotlin.services.groundstation.model.IntegerRange? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.groundstation.model.RangedSocketAddress) : this() {
this.name = x.name
this.portRange = x.portRange
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.groundstation.model.RangedSocketAddress = RangedSocketAddress(this)
/**
* construct an [aws.sdk.kotlin.services.groundstation.model.IntegerRange] inside the given [block]
*/
public fun portRange(block: aws.sdk.kotlin.services.groundstation.model.IntegerRange.Builder.() -> kotlin.Unit) {
this.portRange = aws.sdk.kotlin.services.groundstation.model.IntegerRange.invoke(block)
}
internal fun correctErrors(): Builder {
if (name == null) name = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy