software.amazon.awssdk.services.databasemigration.model.OrderableReplicationInstance Maven / Gradle / Ivy
Show all versions of dms Show documentation
/*
* 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.Objects;
import java.util.Optional;
import software.amazon.awssdk.annotations.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.OrderableReplicationInstanceMarshaller;
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 OrderableReplicationInstance implements StructuredPojo,
ToCopyableBuilder {
private final String engineVersion;
private final String replicationInstanceClass;
private final String storageType;
private final Integer minAllocatedStorage;
private final Integer maxAllocatedStorage;
private final Integer defaultAllocatedStorage;
private final Integer includedAllocatedStorage;
private OrderableReplicationInstance(BuilderImpl builder) {
this.engineVersion = builder.engineVersion;
this.replicationInstanceClass = builder.replicationInstanceClass;
this.storageType = builder.storageType;
this.minAllocatedStorage = builder.minAllocatedStorage;
this.maxAllocatedStorage = builder.maxAllocatedStorage;
this.defaultAllocatedStorage = builder.defaultAllocatedStorage;
this.includedAllocatedStorage = builder.includedAllocatedStorage;
}
/**
*
* The version of the replication engine.
*
*
* @return The version of the replication engine.
*/
public String engineVersion() {
return engineVersion;
}
/**
*
* The compute and memory capacity of the replication instance.
*
*
* Valid Values:
* dms.t2.micro | dms.t2.small | dms.t2.medium | dms.t2.large | dms.c4.large | dms.c4.xlarge | dms.c4.2xlarge | dms.c4.4xlarge
*
*
* @return The compute and memory capacity of the replication instance.
*
* Valid Values:
* dms.t2.micro | dms.t2.small | dms.t2.medium | dms.t2.large | dms.c4.large | dms.c4.xlarge | dms.c4.2xlarge | dms.c4.4xlarge
*/
public String replicationInstanceClass() {
return replicationInstanceClass;
}
/**
*
* The type of storage used by the replication instance.
*
*
* @return The type of storage used by the replication instance.
*/
public String storageType() {
return storageType;
}
/**
*
* The minimum amount of storage (in gigabytes) that can be allocated for the replication instance.
*
*
* @return The minimum amount of storage (in gigabytes) that can be allocated for the replication instance.
*/
public Integer minAllocatedStorage() {
return minAllocatedStorage;
}
/**
*
* The minimum amount of storage (in gigabytes) that can be allocated for the replication instance.
*
*
* @return The minimum amount of storage (in gigabytes) that can be allocated for the replication instance.
*/
public Integer maxAllocatedStorage() {
return maxAllocatedStorage;
}
/**
*
* The default amount of storage (in gigabytes) that is allocated for the replication instance.
*
*
* @return The default amount of storage (in gigabytes) that is allocated for the replication instance.
*/
public Integer defaultAllocatedStorage() {
return defaultAllocatedStorage;
}
/**
*
* The amount of storage (in gigabytes) that is allocated for the replication instance.
*
*
* @return The amount of storage (in gigabytes) that is allocated for the replication instance.
*/
public Integer includedAllocatedStorage() {
return includedAllocatedStorage;
}
@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(engineVersion());
hashCode = 31 * hashCode + Objects.hashCode(replicationInstanceClass());
hashCode = 31 * hashCode + Objects.hashCode(storageType());
hashCode = 31 * hashCode + Objects.hashCode(minAllocatedStorage());
hashCode = 31 * hashCode + Objects.hashCode(maxAllocatedStorage());
hashCode = 31 * hashCode + Objects.hashCode(defaultAllocatedStorage());
hashCode = 31 * hashCode + Objects.hashCode(includedAllocatedStorage());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OrderableReplicationInstance)) {
return false;
}
OrderableReplicationInstance other = (OrderableReplicationInstance) obj;
return Objects.equals(engineVersion(), other.engineVersion())
&& Objects.equals(replicationInstanceClass(), other.replicationInstanceClass())
&& Objects.equals(storageType(), other.storageType())
&& Objects.equals(minAllocatedStorage(), other.minAllocatedStorage())
&& Objects.equals(maxAllocatedStorage(), other.maxAllocatedStorage())
&& Objects.equals(defaultAllocatedStorage(), other.defaultAllocatedStorage())
&& Objects.equals(includedAllocatedStorage(), other.includedAllocatedStorage());
}
@Override
public String toString() {
return ToString.builder("OrderableReplicationInstance").add("EngineVersion", engineVersion())
.add("ReplicationInstanceClass", replicationInstanceClass()).add("StorageType", storageType())
.add("MinAllocatedStorage", minAllocatedStorage()).add("MaxAllocatedStorage", maxAllocatedStorage())
.add("DefaultAllocatedStorage", defaultAllocatedStorage())
.add("IncludedAllocatedStorage", includedAllocatedStorage()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "EngineVersion":
return Optional.ofNullable(clazz.cast(engineVersion()));
case "ReplicationInstanceClass":
return Optional.ofNullable(clazz.cast(replicationInstanceClass()));
case "StorageType":
return Optional.ofNullable(clazz.cast(storageType()));
case "MinAllocatedStorage":
return Optional.ofNullable(clazz.cast(minAllocatedStorage()));
case "MaxAllocatedStorage":
return Optional.ofNullable(clazz.cast(maxAllocatedStorage()));
case "DefaultAllocatedStorage":
return Optional.ofNullable(clazz.cast(defaultAllocatedStorage()));
case "IncludedAllocatedStorage":
return Optional.ofNullable(clazz.cast(includedAllocatedStorage()));
default:
return Optional.empty();
}
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
OrderableReplicationInstanceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
*
* The version of the replication engine.
*
*
* @param engineVersion
* The version of the replication engine.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder engineVersion(String engineVersion);
/**
*
* The compute and memory capacity of the replication instance.
*
*
* Valid Values:
* dms.t2.micro | dms.t2.small | dms.t2.medium | dms.t2.large | dms.c4.large | dms.c4.xlarge | dms.c4.2xlarge | dms.c4.4xlarge
*
*
* @param replicationInstanceClass
* The compute and memory capacity of the replication instance.
*
* Valid Values:
* dms.t2.micro | dms.t2.small | dms.t2.medium | dms.t2.large | dms.c4.large | dms.c4.xlarge | dms.c4.2xlarge | dms.c4.4xlarge
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder replicationInstanceClass(String replicationInstanceClass);
/**
*
* The type of storage used by the replication instance.
*
*
* @param storageType
* The type of storage used by the replication instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder storageType(String storageType);
/**
*
* The minimum amount of storage (in gigabytes) that can be allocated for the replication instance.
*
*
* @param minAllocatedStorage
* The minimum amount of storage (in gigabytes) that can be allocated for the replication instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder minAllocatedStorage(Integer minAllocatedStorage);
/**
*
* The minimum amount of storage (in gigabytes) that can be allocated for the replication instance.
*
*
* @param maxAllocatedStorage
* The minimum amount of storage (in gigabytes) that can be allocated for the replication instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder maxAllocatedStorage(Integer maxAllocatedStorage);
/**
*
* The default amount of storage (in gigabytes) that is allocated for the replication instance.
*
*
* @param defaultAllocatedStorage
* The default amount of storage (in gigabytes) that is allocated for the replication instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder defaultAllocatedStorage(Integer defaultAllocatedStorage);
/**
*
* The amount of storage (in gigabytes) that is allocated for the replication instance.
*
*
* @param includedAllocatedStorage
* The amount of storage (in gigabytes) that is allocated for the replication instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder includedAllocatedStorage(Integer includedAllocatedStorage);
}
static final class BuilderImpl implements Builder {
private String engineVersion;
private String replicationInstanceClass;
private String storageType;
private Integer minAllocatedStorage;
private Integer maxAllocatedStorage;
private Integer defaultAllocatedStorage;
private Integer includedAllocatedStorage;
private BuilderImpl() {
}
private BuilderImpl(OrderableReplicationInstance model) {
engineVersion(model.engineVersion);
replicationInstanceClass(model.replicationInstanceClass);
storageType(model.storageType);
minAllocatedStorage(model.minAllocatedStorage);
maxAllocatedStorage(model.maxAllocatedStorage);
defaultAllocatedStorage(model.defaultAllocatedStorage);
includedAllocatedStorage(model.includedAllocatedStorage);
}
public final String getEngineVersion() {
return engineVersion;
}
@Override
public final Builder engineVersion(String engineVersion) {
this.engineVersion = engineVersion;
return this;
}
public final void setEngineVersion(String engineVersion) {
this.engineVersion = engineVersion;
}
public final String getReplicationInstanceClass() {
return replicationInstanceClass;
}
@Override
public final Builder replicationInstanceClass(String replicationInstanceClass) {
this.replicationInstanceClass = replicationInstanceClass;
return this;
}
public final void setReplicationInstanceClass(String replicationInstanceClass) {
this.replicationInstanceClass = replicationInstanceClass;
}
public final String getStorageType() {
return storageType;
}
@Override
public final Builder storageType(String storageType) {
this.storageType = storageType;
return this;
}
public final void setStorageType(String storageType) {
this.storageType = storageType;
}
public final Integer getMinAllocatedStorage() {
return minAllocatedStorage;
}
@Override
public final Builder minAllocatedStorage(Integer minAllocatedStorage) {
this.minAllocatedStorage = minAllocatedStorage;
return this;
}
public final void setMinAllocatedStorage(Integer minAllocatedStorage) {
this.minAllocatedStorage = minAllocatedStorage;
}
public final Integer getMaxAllocatedStorage() {
return maxAllocatedStorage;
}
@Override
public final Builder maxAllocatedStorage(Integer maxAllocatedStorage) {
this.maxAllocatedStorage = maxAllocatedStorage;
return this;
}
public final void setMaxAllocatedStorage(Integer maxAllocatedStorage) {
this.maxAllocatedStorage = maxAllocatedStorage;
}
public final Integer getDefaultAllocatedStorage() {
return defaultAllocatedStorage;
}
@Override
public final Builder defaultAllocatedStorage(Integer defaultAllocatedStorage) {
this.defaultAllocatedStorage = defaultAllocatedStorage;
return this;
}
public final void setDefaultAllocatedStorage(Integer defaultAllocatedStorage) {
this.defaultAllocatedStorage = defaultAllocatedStorage;
}
public final Integer getIncludedAllocatedStorage() {
return includedAllocatedStorage;
}
@Override
public final Builder includedAllocatedStorage(Integer includedAllocatedStorage) {
this.includedAllocatedStorage = includedAllocatedStorage;
return this;
}
public final void setIncludedAllocatedStorage(Integer includedAllocatedStorage) {
this.includedAllocatedStorage = includedAllocatedStorage;
}
@Override
public OrderableReplicationInstance build() {
return new OrderableReplicationInstance(this);
}
}
}