< Summary

Class:Azure.AI.FormRecognizer.Models.FormField`1
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\FormField{T}.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:59
Line coverage:0% (0 of 13)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
get_Name()-0%100%
get_LabelData()-0%100%
get_ValueData()-0%100%
get_Value()-0%100%
get_Confidence()-0%100%
op_Implicit(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\FormField{T}.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4namespace Azure.AI.FormRecognizer.Models
 5{
 6    /// <summary>
 7    /// Represents a field recognized in the input form, where the field's value is of a known type.
 8    /// </summary>
 9    /// <typeparam name="T">The type of the value in the field this instance represents.</typeparam>
 10    public class FormField<T>
 11    {
 12        /// <summary>
 13        /// Initializes a new instance of the <see cref="FormField{T}"/> class.
 14        /// </summary>
 15        /// <param name="field">The weakly-typed field this instance is associated with.</param>
 16        /// <param name="value">The strongly-typed value of this <see cref="FormField{T}"/>.</param>
 017        public FormField(FormField field, T value)
 18        {
 019            Confidence = field.Confidence;
 020            LabelData = field.LabelData;
 021            Name = field.Name;
 022            ValueData = field.ValueData;
 023            Value = value;
 024        }
 25
 26        /// <summary>
 27        /// Canonical name; uniquely identifies a field within the form.
 28        /// </summary>
 029        public string Name { get; }
 30
 31        /// <summary>
 32        /// Contains the text, bounding box and content of the label of the field in the form.
 33        /// </summary>
 034        public FieldData LabelData { get; }
 35
 36        /// <summary>
 37        /// Contains the text, bounding box and content of the value of the field in the form.
 38        /// </summary>
 039        public FieldData ValueData { get; }
 40
 41        /// <summary>
 42        /// The strongly-typed value of this <see cref="FormField{T}"/>.
 43        /// </summary>
 044        public T Value { get; }
 45
 46        /// <summary>
 47        /// Measures the degree of certainty of the recognition result. Value is between [0.0, 1.0].
 48        /// </summary>
 049        public float Confidence { get; }
 50
 51        /// <summary>
 52        /// Implicitly converts a <see cref="FormField{T}"/> instance into a <typeparamref name="T"/>, using the
 53        /// value returned by <see cref="Value"/>.
 54        /// </summary>
 55        /// <param name="field">The instance to be converted into a <typeparamref name="T"/>.</param>
 56        /// <returns>The <typeparamref name="T"/> corresponding to the value of the specified <see cref="FormField"/> in
 057        public static implicit operator T(FormField<T> field) => field.Value;
 58    }
 59}