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

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

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

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



/**
 * Specifies the sort order of a sorted column.
 */
public class Order private constructor(builder: Builder) {
    /**
     * The name of the column.
     */
    public val column: kotlin.String = requireNotNull(builder.column) { "A non-null value must be provided for column" }
    /**
     * Indicates that the column is sorted in ascending order (`== 1`), or in descending order (`==0`).
     */
    public val sortOrder: kotlin.Int = builder.sortOrder

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

    override fun toString(): kotlin.String = buildString {
        append("Order(")
        append("column=$column,")
        append("sortOrder=$sortOrder")
        append(")")
    }

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

        if (column != other.column) return false
        if (sortOrder != other.sortOrder) return false

        return true
    }

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

    public class Builder {
        /**
         * The name of the column.
         */
        public var column: kotlin.String? = null
        /**
         * Indicates that the column is sorted in ascending order (`== 1`), or in descending order (`==0`).
         */
        public var sortOrder: kotlin.Int = 0

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.Order) : this() {
            this.column = x.column
            this.sortOrder = x.sortOrder
        }

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

        internal fun correctErrors(): Builder {
            if (column == null) column = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy