Class MongoIndex
java.lang.Object
com.azure.resourcemanager.cosmos.models.MongoIndex
- All Implemented Interfaces:
com.azure.json.JsonSerializable<MongoIndex>
Cosmos DB MongoDB collection index key.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MongoIndexfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of MongoIndex from the JsonReader.key()Get the key property: Cosmos DB MongoDB collection index keys.options()Get the options property: Cosmos DB MongoDB collection index key options.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withKey(MongoIndexKeys key) Set the key property: Cosmos DB MongoDB collection index keys.withOptions(MongoIndexOptions options) Set the options property: Cosmos DB MongoDB collection index key options.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
MongoIndex
public MongoIndex()Creates an instance of MongoIndex class.
-
-
Method Details
-
key
Get the key property: Cosmos DB MongoDB collection index keys.- Returns:
- the key value.
-
withKey
Set the key property: Cosmos DB MongoDB collection index keys.- Parameters:
key- the key value to set.- Returns:
- the MongoIndex object itself.
-
options
Get the options property: Cosmos DB MongoDB collection index key options.- Returns:
- the options value.
-
withOptions
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
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<MongoIndex>- Throws:
IOException
-
fromJson
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.
-