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

commonMain.aws.sdk.kotlin.services.finspace.model.PortRange.kt Maven / Gradle / Ivy

There is a newer version: 1.3.77
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.finspace.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The range of ports the rule applies to.
 */
public class PortRange private constructor(builder: Builder) {
    /**
     * The first port in the range.
     */
    public val from: kotlin.Int = builder.from
    /**
     * The last port in the range.
     */
    public val to: kotlin.Int = builder.to

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

    override fun toString(): kotlin.String = buildString {
        append("PortRange(")
        append("from=$from,")
        append("to=$to")
        append(")")
    }

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

        if (from != other.from) return false
        if (to != other.to) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The first port in the range.
         */
        public var from: kotlin.Int = 0
        /**
         * The last port in the range.
         */
        public var to: kotlin.Int = 0

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.finspace.model.PortRange) : this() {
            this.from = x.from
            this.to = x.to
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy