LexicalAnalyzer.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.JsonSubTypes;
  12. import com.fasterxml.jackson.annotation.JsonTypeInfo;
  13. import com.fasterxml.jackson.annotation.JsonTypeName;

  14. /** Base type for analyzers. */
  15. @JsonTypeInfo(
  16.         use = JsonTypeInfo.Id.NAME,
  17.         include = JsonTypeInfo.As.PROPERTY,
  18.         property = "@odata.type",
  19.         defaultImpl = LexicalAnalyzer.class,
  20.         visible = true)
  21. @JsonTypeName("LexicalAnalyzer")
  22. @JsonSubTypes({
  23.     @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.CustomAnalyzer", value = CustomAnalyzer.class),
  24.     @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.PatternAnalyzer", value = PatternAnalyzer.class),
  25.     @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.StandardAnalyzer", value = LuceneStandardAnalyzer.class),
  26.     @JsonSubTypes.Type(name = "#Microsoft.Azure.Search.StopAnalyzer", value = StopAnalyzer.class)
  27. })
  28. @Fluent
  29. public abstract class LexicalAnalyzer {

  30.     /*
  31.      * The name of the analyzer. It must only contain letters, digits, spaces,
  32.      * dashes or underscores, can only start and end with alphanumeric
  33.      * characters, and is limited to 128 characters.
  34.      */
  35.     @JsonProperty(value = "name", required = true)
  36.     private String name;

  37.     /**
  38.      * Creates an instance of LexicalAnalyzer class.
  39.      *
  40.      * @param name the name value to set.
  41.      */
  42.     @JsonCreator
  43.     public LexicalAnalyzer(@JsonProperty(value = "name", required = true) String name) {
  44.         this.name = name;
  45.     }

  46.     /**
  47.      * Get the name property: The name of the analyzer. It must only contain letters, digits, spaces, dashes or
  48.      * underscores, can only start and end with alphanumeric characters, and is limited to 128 characters.
  49.      *
  50.      * @return the name value.
  51.      */
  52.     public String getName() {
  53.         return this.name;
  54.     }
  55. }