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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the expireAfterSeconds property: Expire after seconds.static MongoIndexOptions
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of MongoIndexOptions from the JsonReader.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) unique()
Get the unique property: Is unique or not.void
validate()
Validates the instance.withExpireAfterSeconds
(Integer expireAfterSeconds) Set the expireAfterSeconds property: Expire after seconds.withUnique
(Boolean unique) Set the unique property: Is unique or not.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
-
MongoIndexOptions
public MongoIndexOptions()Creates an instance of MongoIndexOptions class.
-
-
Method Details
-
expireAfterSeconds
Get the expireAfterSeconds property: Expire after seconds.- Returns:
- the expireAfterSeconds value.
-
withExpireAfterSeconds
Set the expireAfterSeconds property: Expire after seconds.- Parameters:
expireAfterSeconds
- the expireAfterSeconds value to set.- Returns:
- the MongoIndexOptions object itself.
-
unique
Get the unique property: Is unique or not.- Returns:
- the unique value.
-
withUnique
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
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<MongoIndexOptions>
- Throws:
IOException
-
fromJson
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.
-