MongoDbShardKeySetting Class

  • java.lang.Object
    • com.azure.resourcemanager.datamigration.models.MongoDbShardKeySetting

Implements

public final class MongoDbShardKeySetting
implements JsonSerializable<MongoDbShardKeySetting>

Describes a MongoDB shard key.

Constructor Summary

Constructor Description
MongoDbShardKeySetting()

Creates an instance of MongoDbShardKeySetting class.

Method Summary

Modifier and Type Method and Description
List<MongoDbShardKeyField> fields()

Get the fields property: The fields within the shard key.

static MongoDbShardKeySetting fromJson(JsonReader jsonReader)

Reads an instance of MongoDbShardKeySetting from the JsonReader.

Boolean isUnique()

Get the isUnique property: Whether the shard key is unique.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

MongoDbShardKeySetting withFields(List<MongoDbShardKeyField> fields)

Set the fields property: The fields within the shard key.

MongoDbShardKeySetting withIsUnique(Boolean isUnique)

Set the isUnique property: Whether the shard key is unique.

Methods inherited from java.lang.Object

Constructor Details

MongoDbShardKeySetting

public MongoDbShardKeySetting()

Creates an instance of MongoDbShardKeySetting class.

Method Details

fields

public List<MongoDbShardKeyField> fields()

Get the fields property: The fields within the shard key.

Returns:

the fields value.

fromJson

public static MongoDbShardKeySetting fromJson(JsonReader jsonReader)

Reads an instance of MongoDbShardKeySetting from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MongoDbShardKeySetting if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

isUnique

public Boolean isUnique()

Get the isUnique property: Whether the shard key is unique.

Returns:

the isUnique value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withFields

public MongoDbShardKeySetting withFields(List<MongoDbShardKeyField> fields)

Set the fields property: The fields within the shard key.

Parameters:

fields - the fields value to set.

Returns:

the MongoDbShardKeySetting object itself.

withIsUnique

public MongoDbShardKeySetting withIsUnique(Boolean isUnique)

Set the isUnique property: Whether the shard key is unique.

Parameters:

isUnique - the isUnique value to set.

Returns:

the MongoDbShardKeySetting object itself.

Applies to