MongoDbShardKeyField Class

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

Implements

public final class MongoDbShardKeyField
implements JsonSerializable<MongoDbShardKeyField>

Describes a field reference within a MongoDB shard key.

Constructor Summary

Constructor Description
MongoDbShardKeyField()

Creates an instance of MongoDbShardKeyField class.

Method Summary

Modifier and Type Method and Description
static MongoDbShardKeyField fromJson(JsonReader jsonReader)

Reads an instance of MongoDbShardKeyField from the JsonReader.

String name()

Get the name property: The name of the field.

MongoDbShardKeyOrder order()

Get the order property: The field ordering.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

MongoDbShardKeyField withName(String name)

Set the name property: The name of the field.

MongoDbShardKeyField withOrder(MongoDbShardKeyOrder order)

Set the order property: The field ordering.

Methods inherited from java.lang.Object

Constructor Details

MongoDbShardKeyField

public MongoDbShardKeyField()

Creates an instance of MongoDbShardKeyField class.

Method Details

fromJson

public static MongoDbShardKeyField fromJson(JsonReader jsonReader)

Reads an instance of MongoDbShardKeyField from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MongoDbShardKeyField 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.

name

public String name()

Get the name property: The name of the field.

Returns:

the name value.

order

public MongoDbShardKeyOrder order()

Get the order property: The field ordering.

Returns:

the order value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withName

public MongoDbShardKeyField withName(String name)

Set the name property: The name of the field.

Parameters:

name - the name value to set.

Returns:

the MongoDbShardKeyField object itself.

withOrder

public MongoDbShardKeyField withOrder(MongoDbShardKeyOrder order)

Set the order property: The field ordering.

Parameters:

order - the order value to set.

Returns:

the MongoDbShardKeyField object itself.

Applies to