Class MongoIndex

java.lang.Object
com.azure.resourcemanager.cosmos.models.MongoIndex
All Implemented Interfaces:
com.azure.json.JsonSerializable<MongoIndex>

public final class MongoIndex extends Object implements com.azure.json.JsonSerializable<MongoIndex>
Cosmos DB MongoDB collection index key.
  • Constructor Details

    • MongoIndex

      public MongoIndex()
      Creates an instance of MongoIndex class.
  • Method Details

    • key

      public MongoIndexKeys key()
      Get the key property: Cosmos DB MongoDB collection index keys.
      Returns:
      the key value.
    • withKey

      public MongoIndex withKey(MongoIndexKeys key)
      Set the key property: Cosmos DB MongoDB collection index keys.
      Parameters:
      key - the key value to set.
      Returns:
      the MongoIndex object itself.
    • options

      public MongoIndexOptions options()
      Get the options property: Cosmos DB MongoDB collection index key options.
      Returns:
      the options value.
    • withOptions

      public MongoIndex withOptions(MongoIndexOptions options)
      Set the options property: Cosmos DB MongoDB collection index key options.
      Parameters:
      options - the options value to set.
      Returns:
      the MongoIndex object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

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

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