PhoneticEncoder.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.fasterxml.jackson.annotation.JsonCreator;
  9. import com.fasterxml.jackson.annotation.JsonValue;

  10. /** Defines values for PhoneticEncoder. */
  11. public enum PhoneticEncoder {
  12.     /** Enum value metaphone. */
  13.     METAPHONE("metaphone"),

  14.     /** Enum value doubleMetaphone. */
  15.     DOUBLE_METAPHONE("doubleMetaphone"),

  16.     /** Enum value soundex. */
  17.     SOUNDEX("soundex"),

  18.     /** Enum value refinedSoundex. */
  19.     REFINED_SOUNDEX("refinedSoundex"),

  20.     /** Enum value caverphone1. */
  21.     CAVERPHONE1("caverphone1"),

  22.     /** Enum value caverphone2. */
  23.     CAVERPHONE2("caverphone2"),

  24.     /** Enum value cologne. */
  25.     COLOGNE("cologne"),

  26.     /** Enum value nysiis. */
  27.     NYSIIS("nysiis"),

  28.     /** Enum value koelnerPhonetik. */
  29.     KOELNER_PHONETIK("koelnerPhonetik"),

  30.     /** Enum value haasePhonetik. */
  31.     HAASE_PHONETIK("haasePhonetik"),

  32.     /** Enum value beiderMorse. */
  33.     BEIDER_MORSE("beiderMorse");

  34.     /** The actual serialized value for a PhoneticEncoder instance. */
  35.     private final String value;

  36.     PhoneticEncoder(String value) {
  37.         this.value = value;
  38.     }

  39.     /**
  40.      * Parses a serialized value to a PhoneticEncoder instance.
  41.      *
  42.      * @param value the serialized value to parse.
  43.      * @return the parsed PhoneticEncoder object, or null if unable to parse.
  44.      */
  45.     @JsonCreator
  46.     public static PhoneticEncoder fromString(String value) {
  47.         PhoneticEncoder[] items = PhoneticEncoder.values();
  48.         for (PhoneticEncoder item : items) {
  49.             if (item.toString().equalsIgnoreCase(value)) {
  50.                 return item;
  51.             }
  52.         }
  53.         return null;
  54.     }

  55.     @JsonValue
  56.     @Override
  57.     public String toString() {
  58.         return this.value;
  59.     }
  60. }