com.amazonaws.services.dynamodbv2.model.TableCreationParameters Maven / Gradle / Ivy
Show all versions of aws-java-sdk-dynamodb 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.dynamodbv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The parameters for the table created as part of the import operation.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TableCreationParameters implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the table created as part of the import operation.
*
*/
private String tableName;
/**
*
* The attributes of the table created as part of the import operation.
*
*/
private java.util.List attributeDefinitions;
/**
*
* The primary key and option sort key of the table created as part of the import operation.
*
*/
private java.util.List keySchema;
/**
*
* The billing mode for provisioning the table created as part of the import operation.
*
*/
private String billingMode;
private ProvisionedThroughput provisionedThroughput;
private SSESpecification sSESpecification;
/**
*
* The Global Secondary Indexes (GSI) of the table to be created as part of the import operation.
*
*/
private java.util.List globalSecondaryIndexes;
/**
*
* The name of the table created as part of the import operation.
*
*
* @param tableName
* The name of the table created as part of the import operation.
*/
public void setTableName(String tableName) {
this.tableName = tableName;
}
/**
*
* The name of the table created as part of the import operation.
*
*
* @return The name of the table created as part of the import operation.
*/
public String getTableName() {
return this.tableName;
}
/**
*
* The name of the table created as part of the import operation.
*
*
* @param tableName
* The name of the table created as part of the import operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableCreationParameters withTableName(String tableName) {
setTableName(tableName);
return this;
}
/**
*
* The attributes of the table created as part of the import operation.
*
*
* @return The attributes of the table created as part of the import operation.
*/
public java.util.List getAttributeDefinitions() {
return attributeDefinitions;
}
/**
*
* The attributes of the table created as part of the import operation.
*
*
* @param attributeDefinitions
* The attributes of the table created as part of the import operation.
*/
public void setAttributeDefinitions(java.util.Collection attributeDefinitions) {
if (attributeDefinitions == null) {
this.attributeDefinitions = null;
return;
}
this.attributeDefinitions = new java.util.ArrayList(attributeDefinitions);
}
/**
*
* The attributes of the table created as part of the import operation.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAttributeDefinitions(java.util.Collection)} or {@link #withAttributeDefinitions(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param attributeDefinitions
* The attributes of the table created as part of the import operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableCreationParameters withAttributeDefinitions(AttributeDefinition... attributeDefinitions) {
if (this.attributeDefinitions == null) {
setAttributeDefinitions(new java.util.ArrayList(attributeDefinitions.length));
}
for (AttributeDefinition ele : attributeDefinitions) {
this.attributeDefinitions.add(ele);
}
return this;
}
/**
*
* The attributes of the table created as part of the import operation.
*
*
* @param attributeDefinitions
* The attributes of the table created as part of the import operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableCreationParameters withAttributeDefinitions(java.util.Collection attributeDefinitions) {
setAttributeDefinitions(attributeDefinitions);
return this;
}
/**
*
* The primary key and option sort key of the table created as part of the import operation.
*
*
* @return The primary key and option sort key of the table created as part of the import operation.
*/
public java.util.List getKeySchema() {
return keySchema;
}
/**
*
* The primary key and option sort key of the table created as part of the import operation.
*
*
* @param keySchema
* The primary key and option sort key of the table created as part of the import operation.
*/
public void setKeySchema(java.util.Collection keySchema) {
if (keySchema == null) {
this.keySchema = null;
return;
}
this.keySchema = new java.util.ArrayList(keySchema);
}
/**
*
* The primary key and option sort key of the table created as part of the import operation.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setKeySchema(java.util.Collection)} or {@link #withKeySchema(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param keySchema
* The primary key and option sort key of the table created as part of the import operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableCreationParameters withKeySchema(KeySchemaElement... keySchema) {
if (this.keySchema == null) {
setKeySchema(new java.util.ArrayList(keySchema.length));
}
for (KeySchemaElement ele : keySchema) {
this.keySchema.add(ele);
}
return this;
}
/**
*
* The primary key and option sort key of the table created as part of the import operation.
*
*
* @param keySchema
* The primary key and option sort key of the table created as part of the import operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableCreationParameters withKeySchema(java.util.Collection keySchema) {
setKeySchema(keySchema);
return this;
}
/**
*
* The billing mode for provisioning the table created as part of the import operation.
*
*
* @param billingMode
* The billing mode for provisioning the table created as part of the import operation.
* @see BillingMode
*/
public void setBillingMode(String billingMode) {
this.billingMode = billingMode;
}
/**
*
* The billing mode for provisioning the table created as part of the import operation.
*
*
* @return The billing mode for provisioning the table created as part of the import operation.
* @see BillingMode
*/
public String getBillingMode() {
return this.billingMode;
}
/**
*
* The billing mode for provisioning the table created as part of the import operation.
*
*
* @param billingMode
* The billing mode for provisioning the table created as part of the import operation.
* @return Returns a reference to this object so that method calls can be chained together.
* @see BillingMode
*/
public TableCreationParameters withBillingMode(String billingMode) {
setBillingMode(billingMode);
return this;
}
/**
*
* The billing mode for provisioning the table created as part of the import operation.
*
*
* @param billingMode
* The billing mode for provisioning the table created as part of the import operation.
* @return Returns a reference to this object so that method calls can be chained together.
* @see BillingMode
*/
public TableCreationParameters withBillingMode(BillingMode billingMode) {
this.billingMode = billingMode.toString();
return this;
}
/**
* @param provisionedThroughput
*/
public void setProvisionedThroughput(ProvisionedThroughput provisionedThroughput) {
this.provisionedThroughput = provisionedThroughput;
}
/**
* @return
*/
public ProvisionedThroughput getProvisionedThroughput() {
return this.provisionedThroughput;
}
/**
* @param provisionedThroughput
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableCreationParameters withProvisionedThroughput(ProvisionedThroughput provisionedThroughput) {
setProvisionedThroughput(provisionedThroughput);
return this;
}
/**
* @param sSESpecification
*/
public void setSSESpecification(SSESpecification sSESpecification) {
this.sSESpecification = sSESpecification;
}
/**
* @return
*/
public SSESpecification getSSESpecification() {
return this.sSESpecification;
}
/**
* @param sSESpecification
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableCreationParameters withSSESpecification(SSESpecification sSESpecification) {
setSSESpecification(sSESpecification);
return this;
}
/**
*
* The Global Secondary Indexes (GSI) of the table to be created as part of the import operation.
*
*
* @return The Global Secondary Indexes (GSI) of the table to be created as part of the import operation.
*/
public java.util.List getGlobalSecondaryIndexes() {
return globalSecondaryIndexes;
}
/**
*
* The Global Secondary Indexes (GSI) of the table to be created as part of the import operation.
*
*
* @param globalSecondaryIndexes
* The Global Secondary Indexes (GSI) of the table to be created as part of the import operation.
*/
public void setGlobalSecondaryIndexes(java.util.Collection globalSecondaryIndexes) {
if (globalSecondaryIndexes == null) {
this.globalSecondaryIndexes = null;
return;
}
this.globalSecondaryIndexes = new java.util.ArrayList(globalSecondaryIndexes);
}
/**
*
* The Global Secondary Indexes (GSI) of the table to be created as part of the import operation.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setGlobalSecondaryIndexes(java.util.Collection)} or
* {@link #withGlobalSecondaryIndexes(java.util.Collection)} if you want to override the existing values.
*
*
* @param globalSecondaryIndexes
* The Global Secondary Indexes (GSI) of the table to be created as part of the import operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableCreationParameters withGlobalSecondaryIndexes(GlobalSecondaryIndex... globalSecondaryIndexes) {
if (this.globalSecondaryIndexes == null) {
setGlobalSecondaryIndexes(new java.util.ArrayList(globalSecondaryIndexes.length));
}
for (GlobalSecondaryIndex ele : globalSecondaryIndexes) {
this.globalSecondaryIndexes.add(ele);
}
return this;
}
/**
*
* The Global Secondary Indexes (GSI) of the table to be created as part of the import operation.
*
*
* @param globalSecondaryIndexes
* The Global Secondary Indexes (GSI) of the table to be created as part of the import operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableCreationParameters withGlobalSecondaryIndexes(java.util.Collection globalSecondaryIndexes) {
setGlobalSecondaryIndexes(globalSecondaryIndexes);
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 (getTableName() != null)
sb.append("TableName: ").append(getTableName()).append(",");
if (getAttributeDefinitions() != null)
sb.append("AttributeDefinitions: ").append(getAttributeDefinitions()).append(",");
if (getKeySchema() != null)
sb.append("KeySchema: ").append(getKeySchema()).append(",");
if (getBillingMode() != null)
sb.append("BillingMode: ").append(getBillingMode()).append(",");
if (getProvisionedThroughput() != null)
sb.append("ProvisionedThroughput: ").append(getProvisionedThroughput()).append(",");
if (getSSESpecification() != null)
sb.append("SSESpecification: ").append(getSSESpecification()).append(",");
if (getGlobalSecondaryIndexes() != null)
sb.append("GlobalSecondaryIndexes: ").append(getGlobalSecondaryIndexes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TableCreationParameters == false)
return false;
TableCreationParameters other = (TableCreationParameters) obj;
if (other.getTableName() == null ^ this.getTableName() == null)
return false;
if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false)
return false;
if (other.getAttributeDefinitions() == null ^ this.getAttributeDefinitions() == null)
return false;
if (other.getAttributeDefinitions() != null && other.getAttributeDefinitions().equals(this.getAttributeDefinitions()) == false)
return false;
if (other.getKeySchema() == null ^ this.getKeySchema() == null)
return false;
if (other.getKeySchema() != null && other.getKeySchema().equals(this.getKeySchema()) == false)
return false;
if (other.getBillingMode() == null ^ this.getBillingMode() == null)
return false;
if (other.getBillingMode() != null && other.getBillingMode().equals(this.getBillingMode()) == false)
return false;
if (other.getProvisionedThroughput() == null ^ this.getProvisionedThroughput() == null)
return false;
if (other.getProvisionedThroughput() != null && other.getProvisionedThroughput().equals(this.getProvisionedThroughput()) == false)
return false;
if (other.getSSESpecification() == null ^ this.getSSESpecification() == null)
return false;
if (other.getSSESpecification() != null && other.getSSESpecification().equals(this.getSSESpecification()) == false)
return false;
if (other.getGlobalSecondaryIndexes() == null ^ this.getGlobalSecondaryIndexes() == null)
return false;
if (other.getGlobalSecondaryIndexes() != null && other.getGlobalSecondaryIndexes().equals(this.getGlobalSecondaryIndexes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode());
hashCode = prime * hashCode + ((getAttributeDefinitions() == null) ? 0 : getAttributeDefinitions().hashCode());
hashCode = prime * hashCode + ((getKeySchema() == null) ? 0 : getKeySchema().hashCode());
hashCode = prime * hashCode + ((getBillingMode() == null) ? 0 : getBillingMode().hashCode());
hashCode = prime * hashCode + ((getProvisionedThroughput() == null) ? 0 : getProvisionedThroughput().hashCode());
hashCode = prime * hashCode + ((getSSESpecification() == null) ? 0 : getSSESpecification().hashCode());
hashCode = prime * hashCode + ((getGlobalSecondaryIndexes() == null) ? 0 : getGlobalSecondaryIndexes().hashCode());
return hashCode;
}
@Override
public TableCreationParameters clone() {
try {
return (TableCreationParameters) 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.dynamodbv2.model.transform.TableCreationParametersMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}