com.amazonaws.services.databasemigrationservice.model.MySqlDataProviderSettings Maven / Gradle / Ivy
Show all versions of aws-java-sdk-dms Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.databasemigrationservice.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Provides information that defines a MySQL data provider.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class MySqlDataProviderSettings implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the MySQL server.
*
*/
private String serverName;
/**
*
* The port value for the MySQL data provider.
*
*/
private Integer port;
/**
*
* The SSL mode used to connect to the MySQL data provider. The default value is none
.
*
*/
private String sslMode;
/**
*
* The Amazon Resource Name (ARN) of the certificate used for SSL connection.
*
*/
private String certificateArn;
/**
*
* The name of the MySQL server.
*
*
* @param serverName
* The name of the MySQL server.
*/
public void setServerName(String serverName) {
this.serverName = serverName;
}
/**
*
* The name of the MySQL server.
*
*
* @return The name of the MySQL server.
*/
public String getServerName() {
return this.serverName;
}
/**
*
* The name of the MySQL server.
*
*
* @param serverName
* The name of the MySQL server.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MySqlDataProviderSettings withServerName(String serverName) {
setServerName(serverName);
return this;
}
/**
*
* The port value for the MySQL data provider.
*
*
* @param port
* The port value for the MySQL data provider.
*/
public void setPort(Integer port) {
this.port = port;
}
/**
*
* The port value for the MySQL data provider.
*
*
* @return The port value for the MySQL data provider.
*/
public Integer getPort() {
return this.port;
}
/**
*
* The port value for the MySQL data provider.
*
*
* @param port
* The port value for the MySQL data provider.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MySqlDataProviderSettings withPort(Integer port) {
setPort(port);
return this;
}
/**
*
* The SSL mode used to connect to the MySQL data provider. The default value is none
.
*
*
* @param sslMode
* The SSL mode used to connect to the MySQL data provider. The default value is none
.
* @see DmsSslModeValue
*/
public void setSslMode(String sslMode) {
this.sslMode = sslMode;
}
/**
*
* The SSL mode used to connect to the MySQL data provider. The default value is none
.
*
*
* @return The SSL mode used to connect to the MySQL data provider. The default value is none
.
* @see DmsSslModeValue
*/
public String getSslMode() {
return this.sslMode;
}
/**
*
* The SSL mode used to connect to the MySQL data provider. The default value is none
.
*
*
* @param sslMode
* The SSL mode used to connect to the MySQL data provider. The default value is none
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DmsSslModeValue
*/
public MySqlDataProviderSettings withSslMode(String sslMode) {
setSslMode(sslMode);
return this;
}
/**
*
* The SSL mode used to connect to the MySQL data provider. The default value is none
.
*
*
* @param sslMode
* The SSL mode used to connect to the MySQL data provider. The default value is none
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DmsSslModeValue
*/
public MySqlDataProviderSettings withSslMode(DmsSslModeValue sslMode) {
this.sslMode = sslMode.toString();
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the certificate used for SSL connection.
*
*
* @param certificateArn
* The Amazon Resource Name (ARN) of the certificate used for SSL connection.
*/
public void setCertificateArn(String certificateArn) {
this.certificateArn = certificateArn;
}
/**
*
* The Amazon Resource Name (ARN) of the certificate used for SSL connection.
*
*
* @return The Amazon Resource Name (ARN) of the certificate used for SSL connection.
*/
public String getCertificateArn() {
return this.certificateArn;
}
/**
*
* The Amazon Resource Name (ARN) of the certificate used for SSL connection.
*
*
* @param certificateArn
* The Amazon Resource Name (ARN) of the certificate used for SSL connection.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MySqlDataProviderSettings withCertificateArn(String certificateArn) {
setCertificateArn(certificateArn);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getServerName() != null)
sb.append("ServerName: ").append(getServerName()).append(",");
if (getPort() != null)
sb.append("Port: ").append(getPort()).append(",");
if (getSslMode() != null)
sb.append("SslMode: ").append(getSslMode()).append(",");
if (getCertificateArn() != null)
sb.append("CertificateArn: ").append(getCertificateArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof MySqlDataProviderSettings == false)
return false;
MySqlDataProviderSettings other = (MySqlDataProviderSettings) obj;
if (other.getServerName() == null ^ this.getServerName() == null)
return false;
if (other.getServerName() != null && other.getServerName().equals(this.getServerName()) == false)
return false;
if (other.getPort() == null ^ this.getPort() == null)
return false;
if (other.getPort() != null && other.getPort().equals(this.getPort()) == false)
return false;
if (other.getSslMode() == null ^ this.getSslMode() == null)
return false;
if (other.getSslMode() != null && other.getSslMode().equals(this.getSslMode()) == false)
return false;
if (other.getCertificateArn() == null ^ this.getCertificateArn() == null)
return false;
if (other.getCertificateArn() != null && other.getCertificateArn().equals(this.getCertificateArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getServerName() == null) ? 0 : getServerName().hashCode());
hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode());
hashCode = prime * hashCode + ((getSslMode() == null) ? 0 : getSslMode().hashCode());
hashCode = prime * hashCode + ((getCertificateArn() == null) ? 0 : getCertificateArn().hashCode());
return hashCode;
}
@Override
public MySqlDataProviderSettings clone() {
try {
return (MySqlDataProviderSettings) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.databasemigrationservice.model.transform.MySqlDataProviderSettingsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}