Class SearchAlias

java.lang.Object
com.azure.search.documents.indexes.models.SearchAlias
All Implemented Interfaces:
com.azure.json.JsonSerializable<SearchAlias>

public final class SearchAlias extends Object implements com.azure.json.JsonSerializable<SearchAlias>
Represents an index alias, which describes a mapping from the alias name to an index. The alias name can be used in place of the index name for supported operations.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SearchAlias(String name, List<String> indexes)
    Creates an instance of SearchAlias class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of SearchAlias from the JsonReader.
    Get the eTag property: The ETag of the alias.
    Get the indexes property: The name of the index this alias maps to.
    Get the name property: The name of the alias.
    Set the eTag property: The ETag of the alias.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • SearchAlias

      public SearchAlias(String name, List<String> indexes)
      Creates an instance of SearchAlias class.
      Parameters:
      name - the name value to set.
      indexes - the indexes value to set.
  • Method Details

    • getName

      public String getName()
      Get the name property: The name of the alias.
      Returns:
      the name value.
    • getIndexes

      public List<String> getIndexes()
      Get the indexes property: The name of the index this alias maps to. Only one index name may be specified.
      Returns:
      the indexes value.
    • getETag

      public String getETag()
      Get the eTag property: The ETag of the alias.
      Returns:
      the eTag value.
    • setETag

      public SearchAlias setETag(String eTag)
      Set the eTag property: The ETag of the alias.
      Parameters:
      eTag - the eTag value to set.
      Returns:
      the SearchAlias object itself.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<SearchAlias>
      Throws:
      IOException
    • fromJson

      public static SearchAlias fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of SearchAlias from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of SearchAlias if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the SearchAlias.