All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.groundstation.model.SocketAddress.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

/**
 * Information about the socket address.
 */
public class SocketAddress private constructor(builder: Builder) {
    /**
     * Name of a socket address.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * Port of a socket address.
     */
    public val port: kotlin.Int = requireNotNull(builder.port) { "A non-null value must be provided for port" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.groundstation.model.SocketAddress = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("SocketAddress(")
        append("name=$name,")
        append("port=$port")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = name.hashCode()
        result = 31 * result + (port)
        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 SocketAddress

        if (name != other.name) return false
        if (port != other.port) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.groundstation.model.SocketAddress = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * Name of a socket address.
         */
        public var name: kotlin.String? = null
        /**
         * Port of a socket address.
         */
        public var port: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.groundstation.model.SocketAddress) : this() {
            this.name = x.name
            this.port = x.port
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.groundstation.model.SocketAddress = SocketAddress(this)

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            if (port == null) port = 0
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy