CustomNormalizer.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.JsonSetter;
  12. import com.fasterxml.jackson.annotation.JsonTypeId;
  13. import com.fasterxml.jackson.annotation.JsonTypeInfo;
  14. import com.fasterxml.jackson.annotation.JsonTypeName;
  15. import java.util.List;

  16. /**
  17.  * Allows you to configure normalization for filterable, sortable, and facetable fields, which by default operate with
  18.  * strict matching. This is a user-defined configuration consisting of at least one or more filters, which modify the
  19.  * token that is stored.
  20.  */
  21. @JsonTypeInfo(
  22.         use = JsonTypeInfo.Id.NAME,
  23.         include = JsonTypeInfo.As.EXISTING_PROPERTY,
  24.         property = "@odata.type",
  25.         visible = true)
  26. @JsonTypeName("#Microsoft.Azure.Search.CustomNormalizer")
  27. @Fluent
  28. public final class CustomNormalizer extends LexicalNormalizer {

  29.     /*
  30.      * Identifies the concrete type of the normalizer.
  31.      */
  32.     @JsonTypeId
  33.     @JsonProperty(value = "@odata.type", required = true)
  34.     private String odataType = "#Microsoft.Azure.Search.CustomNormalizer";

  35.     /*
  36.      * A list of token filters used to filter out or modify the input token.
  37.      * For example, you can specify a lowercase filter that converts all
  38.      * characters to lowercase. The filters are run in the order in which they
  39.      * are listed.
  40.      */
  41.     @JsonProperty(value = "tokenFilters")
  42.     private List<TokenFilterName> tokenFilters;

  43.     /*
  44.      * A list of character filters used to prepare input text before it is
  45.      * processed. For instance, they can replace certain characters or symbols.
  46.      * The filters are run in the order in which they are listed.
  47.      */
  48.     @JsonProperty(value = "charFilters")
  49.     private List<CharFilterName> charFilters;

  50.     /**
  51.      * Creates an instance of CustomNormalizer class.
  52.      *
  53.      * @param name the name value to set.
  54.      */
  55.     @JsonCreator
  56.     public CustomNormalizer(@JsonProperty(value = "name", required = true) String name) {
  57.         super(name);
  58.     }

  59.     /**
  60.      * Get the tokenFilters property: A list of token filters used to filter out or modify the input token. For example,
  61.      * you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in
  62.      * which they are listed.
  63.      *
  64.      * @return the tokenFilters value.
  65.      */
  66.     public List<TokenFilterName> getTokenFilters() {
  67.         return this.tokenFilters;
  68.     }

  69.     /**
  70.      * Set the tokenFilters property: A list of token filters used to filter out or modify the input token. For example,
  71.      * you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in
  72.      * which they are listed.
  73.      *
  74.      * @param tokenFilters the tokenFilters value to set.
  75.      * @return the CustomNormalizer object itself.
  76.      */
  77.     @JsonSetter
  78.     public CustomNormalizer setTokenFilters(List<TokenFilterName> tokenFilters) {
  79.         this.tokenFilters = tokenFilters;
  80.         return this;
  81.     }

  82.     /**
  83.      * Get the charFilters property: A list of character filters used to prepare input text before it is processed. For
  84.      * instance, they can replace certain characters or symbols. The filters are run in the order in which they are
  85.      * listed.
  86.      *
  87.      * @return the charFilters value.
  88.      */
  89.     public List<CharFilterName> getCharFilters() {
  90.         return this.charFilters;
  91.     }

  92.     /**
  93.      * Set the charFilters property: A list of character filters used to prepare input text before it is processed. For
  94.      * instance, they can replace certain characters or symbols. The filters are run in the order in which they are
  95.      * listed.
  96.      *
  97.      * @param charFilters the charFilters value to set.
  98.      * @return the CustomNormalizer object itself.
  99.      */
  100.     @JsonSetter
  101.     public CustomNormalizer setCharFilters(List<CharFilterName> charFilters) {
  102.         this.charFilters = charFilters;
  103.         return this;
  104.     }

  105.     /**
  106.      * Set the tokenFilters property: A list of token filters used to filter out or modify the input token. For example,
  107.      * you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in
  108.      * which they are listed.
  109.      *
  110.      * @param tokenFilters the tokenFilters value to set.
  111.      * @return the CustomNormalizer object itself.
  112.      */
  113.     public CustomNormalizer setTokenFilters(TokenFilterName... tokenFilters) {
  114.         this.tokenFilters = (tokenFilters == null) ? null : java.util.Arrays.asList(tokenFilters);
  115.         return this;
  116.     }

  117.     /**
  118.      * Set the charFilters property: A list of character filters used to prepare input text before it is processed. For
  119.      * instance, they can replace certain characters or symbols. The filters are run in the order in which they are
  120.      * listed.
  121.      *
  122.      * @param charFilters the charFilters value to set.
  123.      * @return the CustomNormalizer object itself.
  124.      */
  125.     public CustomNormalizer setCharFilters(CharFilterName... charFilters) {
  126.         this.charFilters = (charFilters == null) ? null : java.util.Arrays.asList(charFilters);
  127.         return this;
  128.     }
  129. }