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

commonMain.aws.sdk.kotlin.services.glue.model.Segment.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.glue.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Defines a non-overlapping region of a table's partitions, allowing multiple requests to be run in parallel.
 */
public class Segment private constructor(builder: Builder) {
    /**
     * The zero-based index number of the segment. For example, if the total number of segments is 4, `SegmentNumber` values range from 0 through 3.
     */
    public val segmentNumber: kotlin.Int = builder.segmentNumber
    /**
     * The total number of segments.
     */
    public val totalSegments: kotlin.Int = requireNotNull(builder.totalSegments) { "A non-null value must be provided for totalSegments" }

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

    override fun toString(): kotlin.String = buildString {
        append("Segment(")
        append("segmentNumber=$segmentNumber,")
        append("totalSegments=$totalSegments")
        append(")")
    }

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

        if (segmentNumber != other.segmentNumber) return false
        if (totalSegments != other.totalSegments) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The zero-based index number of the segment. For example, if the total number of segments is 4, `SegmentNumber` values range from 0 through 3.
         */
        public var segmentNumber: kotlin.Int = 0
        /**
         * The total number of segments.
         */
        public var totalSegments: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.Segment) : this() {
            this.segmentNumber = x.segmentNumber
            this.totalSegments = x.totalSegments
        }

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

        internal fun correctErrors(): Builder {
            if (totalSegments == null) totalSegments = 0
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy