software.amazon.awssdk.services.databasemigration.model.TableToReload Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dms Show documentation
Show all versions of dms Show documentation
The AWS Java SDK for AWS Database Migration Service module holds the client classes that are used for
communicating with AWS Database Migration Service.
/*
* Copyright 2012-2017 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.util.Objects;
import java.util.Optional;
import javax.annotation.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.services.databasemigration.transform.TableToReloadMarshaller;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
*/
@Generated("software.amazon.awssdk:codegen")
public class TableToReload implements StructuredPojo, ToCopyableBuilder {
private final String schemaName;
private final String tableName;
private TableToReload(BuilderImpl builder) {
this.schemaName = builder.schemaName;
this.tableName = builder.tableName;
}
/**
*
* The schema name of the table to be reloaded.
*
*
* @return The schema name of the table to be reloaded.
*/
public String schemaName() {
return schemaName;
}
/**
*
* The table name of the table to be reloaded.
*
*
* @return The table name of the table to be reloaded.
*/
public String tableName() {
return tableName;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(schemaName());
hashCode = 31 * hashCode + Objects.hashCode(tableName());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof TableToReload)) {
return false;
}
TableToReload other = (TableToReload) obj;
return Objects.equals(schemaName(), other.schemaName()) && Objects.equals(tableName(), other.tableName());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("{");
if (schemaName() != null) {
sb.append("SchemaName: ").append(schemaName()).append(",");
}
if (tableName() != null) {
sb.append("TableName: ").append(tableName()).append(",");
}
if (sb.length() > 1) {
sb.setLength(sb.length() - 1);
}
sb.append("}");
return sb.toString();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "SchemaName":
return Optional.of(clazz.cast(schemaName()));
case "TableName":
return Optional.of(clazz.cast(tableName()));
default:
return Optional.empty();
}
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
TableToReloadMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
*
* The schema name of the table to be reloaded.
*
*
* @param schemaName
* The schema name of the table to be reloaded.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder schemaName(String schemaName);
/**
*
* The table name of the table to be reloaded.
*
*
* @param tableName
* The table name of the table to be reloaded.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tableName(String tableName);
}
static final class BuilderImpl implements Builder {
private String schemaName;
private String tableName;
private BuilderImpl() {
}
private BuilderImpl(TableToReload model) {
schemaName(model.schemaName);
tableName(model.tableName);
}
public final String getSchemaName() {
return schemaName;
}
@Override
public final Builder schemaName(String schemaName) {
this.schemaName = schemaName;
return this;
}
public final void setSchemaName(String schemaName) {
this.schemaName = schemaName;
}
public final String getTableName() {
return tableName;
}
@Override
public final Builder tableName(String tableName) {
this.tableName = tableName;
return this;
}
public final void setTableName(String tableName) {
this.tableName = tableName;
}
@Override
public TableToReload build() {
return new TableToReload(this);
}
}
}