MongoConnectionInformation Class

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

Implements

public final class MongoConnectionInformation
implements JsonSerializable<MongoConnectionInformation>

Mongo Connection.

Constructor Summary

Constructor Description
MongoConnectionInformation()

Creates an instance of MongoConnectionInformation class.

Method Summary

Modifier and Type Method and Description
String connectionString()

Get the connectionString property: ConnectionString to connect to Mongo.

static MongoConnectionInformation fromJson(JsonReader jsonReader)

Reads an instance of MongoConnectionInformation from the JsonReader.

String host()

Get the host property: Host of mongo connection.

String password()

Get the password property: Password to connect to Mongo.

Integer port()

Get the port property: Port of mongo connection.

JsonWriter toJson(JsonWriter jsonWriter)
String username()

Get the username property: User name to connect to Mongo.

Boolean useSsl()

Get the useSsl property: Whether to UseSsl or UseTls to connect to Mongo.

void validate()

Validates the instance.

MongoConnectionInformation withConnectionString(String connectionString)

Set the connectionString property: ConnectionString to connect to Mongo.

MongoConnectionInformation withHost(String host)

Set the host property: Host of mongo connection.

MongoConnectionInformation withPassword(String password)

Set the password property: Password to connect to Mongo.

MongoConnectionInformation withPort(Integer port)

Set the port property: Port of mongo connection.

MongoConnectionInformation withUsername(String username)

Set the username property: User name to connect to Mongo.

MongoConnectionInformation withUseSsl(Boolean useSsl)

Set the useSsl property: Whether to UseSsl or UseTls to connect to Mongo.

Methods inherited from java.lang.Object

Constructor Details

MongoConnectionInformation

public MongoConnectionInformation()

Creates an instance of MongoConnectionInformation class.

Method Details

connectionString

public String connectionString()

Get the connectionString property: ConnectionString to connect to Mongo.

Returns:

the connectionString value.

fromJson

public static MongoConnectionInformation fromJson(JsonReader jsonReader)

Reads an instance of MongoConnectionInformation from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

host

public String host()

Get the host property: Host of mongo connection.

Returns:

the host value.

password

public String password()

Get the password property: Password to connect to Mongo.

Returns:

the password value.

port

public Integer port()

Get the port property: Port of mongo connection.

Returns:

the port value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

username

public String username()

Get the username property: User name to connect to Mongo.

Returns:

the username value.

useSsl

public Boolean useSsl()

Get the useSsl property: Whether to UseSsl or UseTls to connect to Mongo. Default is true.

Returns:

the useSsl value.

validate

public void validate()

Validates the instance.

withConnectionString

public MongoConnectionInformation withConnectionString(String connectionString)

Set the connectionString property: ConnectionString to connect to Mongo.

Parameters:

connectionString - the connectionString value to set.

Returns:

the MongoConnectionInformation object itself.

withHost

public MongoConnectionInformation withHost(String host)

Set the host property: Host of mongo connection.

Parameters:

host - the host value to set.

Returns:

the MongoConnectionInformation object itself.

withPassword

public MongoConnectionInformation withPassword(String password)

Set the password property: Password to connect to Mongo.

Parameters:

password - the password value to set.

Returns:

the MongoConnectionInformation object itself.

withPort

public MongoConnectionInformation withPort(Integer port)

Set the port property: Port of mongo connection.

Parameters:

port - the port value to set.

Returns:

the MongoConnectionInformation object itself.

withUsername

public MongoConnectionInformation withUsername(String username)

Set the username property: User name to connect to Mongo.

Parameters:

username - the username value to set.

Returns:

the MongoConnectionInformation object itself.

withUseSsl

public MongoConnectionInformation withUseSsl(Boolean useSsl)

Set the useSsl property: Whether to UseSsl or UseTls to connect to Mongo. Default is true.

Parameters:

useSsl - the useSsl value to set.

Returns:

the MongoConnectionInformation object itself.

Applies to