Class MongoIndexOptions

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

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

    • MongoIndexOptions

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

    • expireAfterSeconds

      public Integer expireAfterSeconds()
      Get the expireAfterSeconds property: Expire after seconds.
      Returns:
      the expireAfterSeconds value.
    • withExpireAfterSeconds

      public MongoIndexOptions withExpireAfterSeconds(Integer expireAfterSeconds)
      Set the expireAfterSeconds property: Expire after seconds.
      Parameters:
      expireAfterSeconds - the expireAfterSeconds value to set.
      Returns:
      the MongoIndexOptions object itself.
    • unique

      public Boolean unique()
      Get the unique property: Is unique or not.
      Returns:
      the unique value.
    • withUnique

      public MongoIndexOptions withUnique(Boolean unique)
      Set the unique property: Is unique or not.
      Parameters:
      unique - the unique value to set.
      Returns:
      the MongoIndexOptions 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<MongoIndexOptions>
      Throws:
      IOException
    • fromJson

      public static MongoIndexOptions fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of MongoIndexOptions from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of MongoIndexOptions 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 MongoIndexOptions.