![JAR search and dependency download from the Maven repository](/logo.png)
software.amazon.awssdk.services.databasemigration.model.ReloadTablesRequest 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.
The newest version!
/*
* Copyright 2013-2018 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.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class ReloadTablesRequest extends DatabaseMigrationRequest implements
ToCopyableBuilder {
private final String replicationTaskArn;
private final List tablesToReload;
private ReloadTablesRequest(BuilderImpl builder) {
super(builder);
this.replicationTaskArn = builder.replicationTaskArn;
this.tablesToReload = builder.tablesToReload;
}
/**
*
* The Amazon Resource Name (ARN) of the replication instance.
*
*
* @return The Amazon Resource Name (ARN) of the replication instance.
*/
public String replicationTaskArn() {
return replicationTaskArn;
}
/**
*
* The name and schema of the table to be reloaded.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The name and schema of the table to be reloaded.
*/
public List tablesToReload() {
return tablesToReload;
}
@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(replicationTaskArn());
hashCode = 31 * hashCode + Objects.hashCode(tablesToReload());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ReloadTablesRequest)) {
return false;
}
ReloadTablesRequest other = (ReloadTablesRequest) obj;
return Objects.equals(replicationTaskArn(), other.replicationTaskArn())
&& Objects.equals(tablesToReload(), other.tablesToReload());
}
@Override
public String toString() {
return ToString.builder("ReloadTablesRequest").add("ReplicationTaskArn", replicationTaskArn())
.add("TablesToReload", tablesToReload()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ReplicationTaskArn":
return Optional.ofNullable(clazz.cast(replicationTaskArn()));
case "TablesToReload":
return Optional.ofNullable(clazz.cast(tablesToReload()));
default:
return Optional.empty();
}
}
public interface Builder extends DatabaseMigrationRequest.Builder, CopyableBuilder {
/**
*
* The Amazon Resource Name (ARN) of the replication instance.
*
*
* @param replicationTaskArn
* The Amazon Resource Name (ARN) of the replication instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder replicationTaskArn(String replicationTaskArn);
/**
*
* The name and schema of the table to be reloaded.
*
*
* @param tablesToReload
* The name and schema of the table to be reloaded.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tablesToReload(Collection tablesToReload);
/**
*
* The name and schema of the table to be reloaded.
*
*
* @param tablesToReload
* The name and schema of the table to be reloaded.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tablesToReload(TableToReload... tablesToReload);
/**
*
* The name and schema of the table to be reloaded.
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need
* to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and
* its result is passed to {@link #tablesToReload(List)}.
*
* @param tablesToReload
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #tablesToReload(List)
*/
Builder tablesToReload(Consumer... tablesToReload);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends DatabaseMigrationRequest.BuilderImpl implements Builder {
private String replicationTaskArn;
private List tablesToReload = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(ReloadTablesRequest model) {
super(model);
replicationTaskArn(model.replicationTaskArn);
tablesToReload(model.tablesToReload);
}
public final String getReplicationTaskArn() {
return replicationTaskArn;
}
@Override
public final Builder replicationTaskArn(String replicationTaskArn) {
this.replicationTaskArn = replicationTaskArn;
return this;
}
public final void setReplicationTaskArn(String replicationTaskArn) {
this.replicationTaskArn = replicationTaskArn;
}
public final Collection getTablesToReload() {
return tablesToReload != null ? tablesToReload.stream().map(TableToReload::toBuilder).collect(Collectors.toList())
: null;
}
@Override
public final Builder tablesToReload(Collection tablesToReload) {
this.tablesToReload = TableListToReloadCopier.copy(tablesToReload);
return this;
}
@Override
@SafeVarargs
public final Builder tablesToReload(TableToReload... tablesToReload) {
tablesToReload(Arrays.asList(tablesToReload));
return this;
}
@Override
@SafeVarargs
public final Builder tablesToReload(Consumer... tablesToReload) {
tablesToReload(Stream.of(tablesToReload).map(c -> TableToReload.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setTablesToReload(Collection tablesToReload) {
this.tablesToReload = TableListToReloadCopier.copyFromBuilder(tablesToReload);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public ReloadTablesRequest build() {
return new ReloadTablesRequest(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy