< Summary

Class:Microsoft.Azure.Search.Models.BlobExtractionMode
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Customizations\Indexers\Models\BlobExtractionMode.cs
Covered lines:8
Uncovered lines:6
Coverable lines:14
Total lines:101
Line coverage:57.1% (8 of 14)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.cctor()-100%100%
.ctor(...)-100%100%
op_Implicit(...)-0%100%
op_Explicit(...)-100%100%
op_Equality(...)-0%100%
op_Inequality(...)-0%100%
Equals(...)-0%100%
Equals(...)-0%0%
GetHashCode()-0%100%
ToString()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Customizations\Indexers\Models\BlobExtractionMode.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for
 3// license information.
 4
 5using System;
 6using Microsoft.Azure.Search.Common;
 7using Microsoft.Azure.Search.Serialization;
 8using Newtonsoft.Json;
 9
 10namespace Microsoft.Azure.Search.Models
 11{
 12    /// <summary>
 13    /// Defines which parts of a blob will be indexed by the blob storage indexer.
 14    /// <see href="https://docs.microsoft.com/azure/search/search-howto-indexing-azure-blob-storage" />
 15    /// </summary>
 16    [JsonConverter(typeof(ExtensibleEnumConverter<BlobExtractionMode>))]
 17    public struct BlobExtractionMode : IEquatable<BlobExtractionMode>
 18    {
 19        private readonly string _value;
 20
 21        /// <summary>
 22        /// Specifies that only the standard blob properties and user-specified metadata will be indexed.
 23        /// For more information, see <see href="https://docs.microsoft.com/azure/storage/blobs/storage-blob-container-p
 24        /// </summary>
 225        public static readonly BlobExtractionMode StorageMetadata = new BlobExtractionMode("storageMetadata");
 26
 27        /// <summary>
 28        /// Specifies that storage metadata and the content-type specific metadata extracted from the blob content will 
 29        /// For more information, see <see href="https://docs.microsoft.com/azure/search/search-howto-indexing-azure-blo
 30        /// </summary>
 231        public static readonly BlobExtractionMode AllMetadata = new BlobExtractionMode("allMetadata");
 32
 33        /// <summary>
 34        /// Specifies that all metadata and textual content extracted from the blob will be indexed. This is the default
 35        /// For more information, see <see href="https://docs.microsoft.com/azure/search/search-howto-indexing-azure-blo
 36        /// </summary>
 237        public static readonly BlobExtractionMode ContentAndMetadata = new BlobExtractionMode("contentAndMetadata");
 38
 39        private BlobExtractionMode(string mode)
 40        {
 641            Throw.IfArgumentNull(mode, nameof(mode));
 642            _value = mode;
 643        }
 44
 45        /// <summary>
 46        /// Defines implicit conversion from string to BlobExtractionMode.
 47        /// </summary>
 48        /// <param name="value">string to convert.</param>
 49        /// <returns>The string as a BlobExtractionMode.</returns>
 050        public static implicit operator BlobExtractionMode(string value) => new BlobExtractionMode(value);
 51
 52        /// <summary>
 53        /// Defines explicit conversion from BlobExtractionMode to string.
 54        /// </summary>
 55        /// <param name="mode">BlobExtractionMode to convert.</param>
 56        /// <returns>The BlobExtractionMode as a string.</returns>
 657        public static explicit operator string(BlobExtractionMode mode) => mode.ToString();
 58
 59        /// <summary>
 60        /// Compares two BlobExtractionMode values for equality.
 61        /// </summary>
 62        /// <param name="lhs">The first BlobExtractionMode to compare.</param>
 63        /// <param name="rhs">The second BlobExtractionMode to compare.</param>
 64        /// <returns>true if the BlobExtractionMode objects are equal or are both null; false otherwise.</returns>
 065        public static bool operator ==(BlobExtractionMode lhs, BlobExtractionMode rhs) => Equals(lhs, rhs);
 66
 67        /// <summary>
 68        /// Compares two BlobExtractionMode values for inequality.
 69        /// </summary>
 70        /// <param name="lhs">The first BlobExtractionMode to compare.</param>
 71        /// <param name="rhs">The second BlobExtractionMode to compare.</param>
 72        /// <returns>true if the BlobExtractionMode objects are not equal; false otherwise.</returns>
 073        public static bool operator !=(BlobExtractionMode lhs, BlobExtractionMode rhs) => !Equals(lhs, rhs);
 74
 75        /// <summary>
 76        /// Compares the BlobExtractionMode for equality with another BlobExtractionMode.
 77        /// </summary>
 78        /// <param name="other">The BlobExtractionMode with which to compare.</param>
 79        /// <returns><c>true</c> if the BlobExtractionMode objects are equal; otherwise, <c>false</c>.</returns>
 080        public bool Equals(BlobExtractionMode other) => _value == other._value;
 81
 82        /// <summary>
 83        /// Determines whether the specified object is equal to the current object.
 84        /// </summary>
 85        /// <param name="obj">The object to compare with the current object.</param>
 86        /// <returns><c>true</c> if the specified object is equal to the current object; otherwise, <c>false</c>.</retur
 087        public override bool Equals(object obj) => obj is BlobExtractionMode ? Equals((BlobExtractionMode)obj) : false;
 88
 89        /// <summary>
 90        /// Serves as the default hash function.
 91        /// </summary>
 92        /// <returns>A hash code for the current object.</returns>
 093        public override int GetHashCode() => _value.GetHashCode();
 94
 95        /// <summary>
 96        /// Returns a string representation of the BlobExtractionMode.
 97        /// </summary>
 98        /// <returns>The BlobExtractionMode as a string.</returns>
 699        public override string ToString() => _value;
 100    }
 101}