TokenCharacterKind.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 TokenCharacterKind. */
  11. public enum TokenCharacterKind {
  12.     /** Enum value letter. */
  13.     LETTER("letter"),

  14.     /** Enum value digit. */
  15.     DIGIT("digit"),

  16.     /** Enum value whitespace. */
  17.     WHITESPACE("whitespace"),

  18.     /** Enum value punctuation. */
  19.     PUNCTUATION("punctuation"),

  20.     /** Enum value symbol. */
  21.     SYMBOL("symbol");

  22.     /** The actual serialized value for a TokenCharacterKind instance. */
  23.     private final String value;

  24.     TokenCharacterKind(String value) {
  25.         this.value = value;
  26.     }

  27.     /**
  28.      * Parses a serialized value to a TokenCharacterKind instance.
  29.      *
  30.      * @param value the serialized value to parse.
  31.      * @return the parsed TokenCharacterKind object, or null if unable to parse.
  32.      */
  33.     @JsonCreator
  34.     public static TokenCharacterKind fromString(String value) {
  35.         TokenCharacterKind[] items = TokenCharacterKind.values();
  36.         for (TokenCharacterKind item : items) {
  37.             if (item.toString().equalsIgnoreCase(value)) {
  38.                 return item;
  39.             }
  40.         }
  41.         return null;
  42.     }

  43.     @JsonValue
  44.     @Override
  45.     public String toString() {
  46.         return this.value;
  47.     }
  48. }