All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.databasemigration.model.MariaDbDataProviderSettings Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Database Migration Service module holds the client classes that are used for communicating with AWS Database Migration Service.

There is a newer version: 2.29.15
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.databasemigration.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Provides information that defines a MariaDB data provider. *

*/ @Generated("software.amazon.awssdk:codegen") public final class MariaDbDataProviderSettings implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField SERVER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ServerName").getter(getter(MariaDbDataProviderSettings::serverName)).setter(setter(Builder::serverName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerName").build()).build(); private static final SdkField PORT_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Port") .getter(getter(MariaDbDataProviderSettings::port)).setter(setter(Builder::port)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Port").build()).build(); private static final SdkField SSL_MODE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SslMode").getter(getter(MariaDbDataProviderSettings::sslModeAsString)).setter(setter(Builder::sslMode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SslMode").build()).build(); private static final SdkField CERTIFICATE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CertificateArn").getter(getter(MariaDbDataProviderSettings::certificateArn)) .setter(setter(Builder::certificateArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CertificateArn").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SERVER_NAME_FIELD, PORT_FIELD, SSL_MODE_FIELD, CERTIFICATE_ARN_FIELD)); private static final long serialVersionUID = 1L; private final String serverName; private final Integer port; private final String sslMode; private final String certificateArn; private MariaDbDataProviderSettings(BuilderImpl builder) { this.serverName = builder.serverName; this.port = builder.port; this.sslMode = builder.sslMode; this.certificateArn = builder.certificateArn; } /** *

* The name of the MariaDB server. *

* * @return The name of the MariaDB server. */ public final String serverName() { return serverName; } /** *

* The port value for the MariaDB data provider *

* * @return The port value for the MariaDB data provider */ public final Integer port() { return port; } /** *

* The SSL mode used to connect to the MariaDB data provider. The default value is none. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #sslMode} will * return {@link DmsSslModeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #sslModeAsString}. *

* * @return The SSL mode used to connect to the MariaDB data provider. The default value is none. * @see DmsSslModeValue */ public final DmsSslModeValue sslMode() { return DmsSslModeValue.fromValue(sslMode); } /** *

* The SSL mode used to connect to the MariaDB data provider. The default value is none. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #sslMode} will * return {@link DmsSslModeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #sslModeAsString}. *

* * @return The SSL mode used to connect to the MariaDB data provider. The default value is none. * @see DmsSslModeValue */ public final String sslModeAsString() { return sslMode; } /** *

* 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 final String certificateArn() { return certificateArn; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(serverName()); hashCode = 31 * hashCode + Objects.hashCode(port()); hashCode = 31 * hashCode + Objects.hashCode(sslModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(certificateArn()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof MariaDbDataProviderSettings)) { return false; } MariaDbDataProviderSettings other = (MariaDbDataProviderSettings) obj; return Objects.equals(serverName(), other.serverName()) && Objects.equals(port(), other.port()) && Objects.equals(sslModeAsString(), other.sslModeAsString()) && Objects.equals(certificateArn(), other.certificateArn()); } /** * 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. */ @Override public final String toString() { return ToString.builder("MariaDbDataProviderSettings").add("ServerName", serverName()).add("Port", port()) .add("SslMode", sslModeAsString()).add("CertificateArn", certificateArn()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ServerName": return Optional.ofNullable(clazz.cast(serverName())); case "Port": return Optional.ofNullable(clazz.cast(port())); case "SslMode": return Optional.ofNullable(clazz.cast(sslModeAsString())); case "CertificateArn": return Optional.ofNullable(clazz.cast(certificateArn())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((MariaDbDataProviderSettings) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the MariaDB server. *

* * @param serverName * The name of the MariaDB server. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serverName(String serverName); /** *

* The port value for the MariaDB data provider *

* * @param port * The port value for the MariaDB data provider * @return Returns a reference to this object so that method calls can be chained together. */ Builder port(Integer port); /** *

* The SSL mode used to connect to the MariaDB data provider. The default value is none. *

* * @param sslMode * The SSL mode used to connect to the MariaDB data provider. The default value is none. * @see DmsSslModeValue * @return Returns a reference to this object so that method calls can be chained together. * @see DmsSslModeValue */ Builder sslMode(String sslMode); /** *

* The SSL mode used to connect to the MariaDB data provider. The default value is none. *

* * @param sslMode * The SSL mode used to connect to the MariaDB data provider. The default value is none. * @see DmsSslModeValue * @return Returns a reference to this object so that method calls can be chained together. * @see DmsSslModeValue */ Builder sslMode(DmsSslModeValue sslMode); /** *

* 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. */ Builder certificateArn(String certificateArn); } static final class BuilderImpl implements Builder { private String serverName; private Integer port; private String sslMode; private String certificateArn; private BuilderImpl() { } private BuilderImpl(MariaDbDataProviderSettings model) { serverName(model.serverName); port(model.port); sslMode(model.sslMode); certificateArn(model.certificateArn); } public final String getServerName() { return serverName; } public final void setServerName(String serverName) { this.serverName = serverName; } @Override public final Builder serverName(String serverName) { this.serverName = serverName; return this; } public final Integer getPort() { return port; } public final void setPort(Integer port) { this.port = port; } @Override public final Builder port(Integer port) { this.port = port; return this; } public final String getSslMode() { return sslMode; } public final void setSslMode(String sslMode) { this.sslMode = sslMode; } @Override public final Builder sslMode(String sslMode) { this.sslMode = sslMode; return this; } @Override public final Builder sslMode(DmsSslModeValue sslMode) { this.sslMode(sslMode == null ? null : sslMode.toString()); return this; } public final String getCertificateArn() { return certificateArn; } public final void setCertificateArn(String certificateArn) { this.certificateArn = certificateArn; } @Override public final Builder certificateArn(String certificateArn) { this.certificateArn = certificateArn; return this; } @Override public MariaDbDataProviderSettings build() { return new MariaDbDataProviderSettings(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy