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

commonMain.aws.sdk.kotlin.services.textract.model.Point.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.textract.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The X and Y coordinates of a point on a document page. The X and Y values that are returned are ratios of the overall document page size. For example, if the input document is 700 x 200 and the operation returns X=0.5 and Y=0.25, then the point is at the (350,50) pixel coordinate on the document page.
 *
 * An array of `Point` objects, `Polygon`, is returned by DetectDocumentText. `Polygon` represents a fine-grained polygon around detected text. For more information, see Geometry in the Amazon Textract Developer Guide.
 */
public class Point private constructor(builder: Builder) {
    /**
     * The value of the X coordinate for a point on a `Polygon`.
     */
    public val x: kotlin.Float = builder.x
    /**
     * The value of the Y coordinate for a point on a `Polygon`.
     */
    public val y: kotlin.Float = builder.y

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

    override fun toString(): kotlin.String = buildString {
        append("Point(")
        append("x=$x,")
        append("y=$y")
        append(")")
    }

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

        if (!(x?.equals(other.x) ?: (other.x == null))) return false
        if (!(y?.equals(other.y) ?: (other.y == null))) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The value of the X coordinate for a point on a `Polygon`.
         */
        public var x: kotlin.Float = 0f
        /**
         * The value of the Y coordinate for a point on a `Polygon`.
         */
        public var y: kotlin.Float = 0f

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.textract.model.Point) : this() {
            this.x = x.x
            this.y = x.y
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy