com.amazonaws.services.dynamodbv2.model.TableAutoScalingDescription Maven / Gradle / Ivy
Show all versions of aws-java-sdk-dynamodb Show documentation
/*
* Copyright 2018-2023 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;
/**
*
* Represents the auto scaling configuration for a global table.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TableAutoScalingDescription implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the table.
*
*/
private String tableName;
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
*
*/
private String tableStatus;
/**
*
* Represents replicas of the global table.
*
*/
private java.util.List replicas;
/**
*
* The name of the table.
*
*
* @param tableName
* The name of the table.
*/
public void setTableName(String tableName) {
this.tableName = tableName;
}
/**
*
* The name of the table.
*
*
* @return The name of the table.
*/
public String getTableName() {
return this.tableName;
}
/**
*
* The name of the table.
*
*
* @param tableName
* The name of the table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableAutoScalingDescription withTableName(String tableName) {
setTableName(tableName);
return this;
}
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
*
*
* @param tableStatus
* The current state of the table:
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* @see TableStatus
*/
public void setTableStatus(String tableStatus) {
this.tableStatus = tableStatus;
}
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
*
*
* @return The current state of the table:
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* @see TableStatus
*/
public String getTableStatus() {
return this.tableStatus;
}
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
*
*
* @param tableStatus
* The current state of the table:
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see TableStatus
*/
public TableAutoScalingDescription withTableStatus(String tableStatus) {
setTableStatus(tableStatus);
return this;
}
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
*
*
* @param tableStatus
* The current state of the table:
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see TableStatus
*/
public TableAutoScalingDescription withTableStatus(TableStatus tableStatus) {
this.tableStatus = tableStatus.toString();
return this;
}
/**
*
* Represents replicas of the global table.
*
*
* @return Represents replicas of the global table.
*/
public java.util.List getReplicas() {
return replicas;
}
/**
*
* Represents replicas of the global table.
*
*
* @param replicas
* Represents replicas of the global table.
*/
public void setReplicas(java.util.Collection replicas) {
if (replicas == null) {
this.replicas = null;
return;
}
this.replicas = new java.util.ArrayList(replicas);
}
/**
*
* Represents replicas of the global table.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setReplicas(java.util.Collection)} or {@link #withReplicas(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param replicas
* Represents replicas of the global table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableAutoScalingDescription withReplicas(ReplicaAutoScalingDescription... replicas) {
if (this.replicas == null) {
setReplicas(new java.util.ArrayList(replicas.length));
}
for (ReplicaAutoScalingDescription ele : replicas) {
this.replicas.add(ele);
}
return this;
}
/**
*
* Represents replicas of the global table.
*
*
* @param replicas
* Represents replicas of the global table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableAutoScalingDescription withReplicas(java.util.Collection replicas) {
setReplicas(replicas);
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 (getTableStatus() != null)
sb.append("TableStatus: ").append(getTableStatus()).append(",");
if (getReplicas() != null)
sb.append("Replicas: ").append(getReplicas());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TableAutoScalingDescription == false)
return false;
TableAutoScalingDescription other = (TableAutoScalingDescription) obj;
if (other.getTableName() == null ^ this.getTableName() == null)
return false;
if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false)
return false;
if (other.getTableStatus() == null ^ this.getTableStatus() == null)
return false;
if (other.getTableStatus() != null && other.getTableStatus().equals(this.getTableStatus()) == false)
return false;
if (other.getReplicas() == null ^ this.getReplicas() == null)
return false;
if (other.getReplicas() != null && other.getReplicas().equals(this.getReplicas()) == 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 + ((getTableStatus() == null) ? 0 : getTableStatus().hashCode());
hashCode = prime * hashCode + ((getReplicas() == null) ? 0 : getReplicas().hashCode());
return hashCode;
}
@Override
public TableAutoScalingDescription clone() {
try {
return (TableAutoScalingDescription) 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.TableAutoScalingDescriptionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}