IndexerStatus.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 IndexerStatus. */
  11. public enum IndexerStatus {
  12.     /** Enum value unknown. */
  13.     UNKNOWN("unknown"),

  14.     /** Enum value error. */
  15.     ERROR("error"),

  16.     /** Enum value running. */
  17.     RUNNING("running");

  18.     /** The actual serialized value for a IndexerStatus instance. */
  19.     private final String value;

  20.     IndexerStatus(String value) {
  21.         this.value = value;
  22.     }

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

  39.     @JsonValue
  40.     @Override
  41.     public String toString() {
  42.         return this.value;
  43.     }
  44. }