OcrSkill.java

  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License.
  3. //
  4. // Code generated by Microsoft (R) AutoRest Code Generator.
  5. // Changes may cause incorrect behavior and will be lost if the code is
  6. // regenerated.
  7. package com.azure.search.documents.indexes.models;

  8. import com.azure.core.annotation.Fluent;
  9. import com.fasterxml.jackson.annotation.JsonCreator;
  10. import com.fasterxml.jackson.annotation.JsonProperty;
  11. import com.fasterxml.jackson.annotation.JsonTypeId;
  12. import com.fasterxml.jackson.annotation.JsonTypeInfo;
  13. import com.fasterxml.jackson.annotation.JsonTypeName;
  14. import java.util.List;

  15. /** A skill that extracts text from image files. */
  16. @JsonTypeInfo(
  17.         use = JsonTypeInfo.Id.NAME,
  18.         include = JsonTypeInfo.As.EXISTING_PROPERTY,
  19.         property = "@odata.type",
  20.         visible = true)
  21. @JsonTypeName("#Microsoft.Skills.Vision.OcrSkill")
  22. @Fluent
  23. public final class OcrSkill extends SearchIndexerSkill {

  24.     /*
  25.      * Identifies the concrete type of the skill.
  26.      */
  27.     @JsonTypeId
  28.     @JsonProperty(value = "@odata.type", required = true)
  29.     private String odataType = "#Microsoft.Skills.Vision.OcrSkill";

  30.     /*
  31.      * A value indicating which language code to use. Default is en.
  32.      */
  33.     @JsonProperty(value = "defaultLanguageCode")
  34.     private OcrSkillLanguage defaultLanguageCode;

  35.     /*
  36.      * A value indicating to turn orientation detection on or not. Default is
  37.      * false.
  38.      */
  39.     @JsonProperty(value = "detectOrientation")
  40.     private Boolean shouldDetectOrientation;

  41.     /*
  42.      * Defines the sequence of characters to use between the lines of text
  43.      * recognized by the OCR skill. The default value is "space".
  44.      */
  45.     @JsonProperty(value = "lineEnding")
  46.     private LineEnding lineEnding;

  47.     /**
  48.      * Creates an instance of OcrSkill class.
  49.      *
  50.      * @param inputs the inputs value to set.
  51.      * @param outputs the outputs value to set.
  52.      */
  53.     @JsonCreator
  54.     public OcrSkill(
  55.             @JsonProperty(value = "inputs", required = true) List<InputFieldMappingEntry> inputs,
  56.             @JsonProperty(value = "outputs", required = true) List<OutputFieldMappingEntry> outputs) {
  57.         super(inputs, outputs);
  58.     }

  59.     /**
  60.      * Get the defaultLanguageCode property: A value indicating which language code to use. Default is en.
  61.      *
  62.      * @return the defaultLanguageCode value.
  63.      */
  64.     public OcrSkillLanguage getDefaultLanguageCode() {
  65.         return this.defaultLanguageCode;
  66.     }

  67.     /**
  68.      * Set the defaultLanguageCode property: A value indicating which language code to use. Default is en.
  69.      *
  70.      * @param defaultLanguageCode the defaultLanguageCode value to set.
  71.      * @return the OcrSkill object itself.
  72.      */
  73.     public OcrSkill setDefaultLanguageCode(OcrSkillLanguage defaultLanguageCode) {
  74.         this.defaultLanguageCode = defaultLanguageCode;
  75.         return this;
  76.     }

  77.     /**
  78.      * Get the shouldDetectOrientation property: A value indicating to turn orientation detection on or not. Default is
  79.      * false.
  80.      *
  81.      * @return the shouldDetectOrientation value.
  82.      */
  83.     public Boolean isShouldDetectOrientation() {
  84.         return this.shouldDetectOrientation;
  85.     }

  86.     /**
  87.      * Set the shouldDetectOrientation property: A value indicating to turn orientation detection on or not. Default is
  88.      * false.
  89.      *
  90.      * @param shouldDetectOrientation the shouldDetectOrientation value to set.
  91.      * @return the OcrSkill object itself.
  92.      */
  93.     public OcrSkill setShouldDetectOrientation(Boolean shouldDetectOrientation) {
  94.         this.shouldDetectOrientation = shouldDetectOrientation;
  95.         return this;
  96.     }

  97.     /**
  98.      * Get the lineEnding property: Defines the sequence of characters to use between the lines of text recognized by
  99.      * the OCR skill. The default value is "space".
  100.      *
  101.      * @return the lineEnding value.
  102.      */
  103.     public LineEnding getLineEnding() {
  104.         return this.lineEnding;
  105.     }

  106.     /**
  107.      * Set the lineEnding property: Defines the sequence of characters to use between the lines of text recognized by
  108.      * the OCR skill. The default value is "space".
  109.      *
  110.      * @param lineEnding the lineEnding value to set.
  111.      * @return the OcrSkill object itself.
  112.      */
  113.     public OcrSkill setLineEnding(LineEnding lineEnding) {
  114.         this.lineEnding = lineEnding;
  115.         return this;
  116.     }

  117.     /**
  118.      * Get the shouldDetectOrientation property: A value indicating to turn orientation detection on or not. Default is
  119.      * false.
  120.      *
  121.      * @return the shouldDetectOrientation value.
  122.      * @deprecated Use {@link #isShouldDetectOrientation()} instead.
  123.      */
  124.     @Deprecated
  125.     public Boolean setShouldDetectOrientation() {
  126.         return this.shouldDetectOrientation;
  127.     }
  128. }