// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.ai.formrecognizer.documentanalysis.implementation.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/**
 * A word object consisting of a contiguous sequence of characters. For non-space delimited languages, such as Chinese,
 * Japanese, and Korean, each character is represented as its own word.
 */
@Immutable
public final class DocumentWord {
    /*
     * Text content of the word.
     */
    @JsonProperty(value = "content", required = true)
    private String content;

    /*
     * Bounding polygon of the word.
     */
    @JsonProperty(value = "polygon")
    private List<Float> polygon;

    /*
     * Location of the word in the reading order concatenated content.
     */
    @JsonProperty(value = "span", required = true)
    private DocumentSpan span;

    /*
     * Confidence of correctly extracting the word.
     */
    @JsonProperty(value = "confidence", required = true)
    private float confidence;

    /**
     * Creates an instance of DocumentWord class.
     *
     * @param content the content value to set.
     * @param span the span value to set.
     * @param confidence the confidence value to set.
     */
    @JsonCreator
    private DocumentWord(
            @JsonProperty(value = "content", required = true) String content,
            @JsonProperty(value = "span", required = true) DocumentSpan span,
            @JsonProperty(value = "confidence", required = true) float confidence) {
        this.content = content;
        this.span = span;
        this.confidence = confidence;
    }

    /**
     * Get the content property: Text content of the word.
     *
     * @return the content value.
     */
    public String getContent() {
        return this.content;
    }

    /**
     * Get the polygon property: Bounding polygon of the word.
     *
     * @return the polygon value.
     */
    public List<Float> getPolygon() {
        return this.polygon;
    }

    /**
     * Get the span property: Location of the word in the reading order concatenated content.
     *
     * @return the span value.
     */
    public DocumentSpan getSpan() {
        return this.span;
    }

    /**
     * Get the confidence property: Confidence of correctly extracting the word.
     *
     * @return the confidence value.
     */
    public float getConfidence() {
        return this.confidence;
    }
}
