/* * Copyright 2010-2019 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 com.amazonaws.AmazonWebServiceRequest; /** *

* Updates settings for a global table. *

*/ public class UpdateGlobalTableSettingsRequest extends AmazonWebServiceRequest implements Serializable { /** *

* The name of the global table *

*

* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
*/ private String globalTableName; /** *

* The maximum number of writes consumed per second before DynamoDB returns * a ThrottlingException. *

*

* Constraints:
* Range: 1 -
*/ private Long globalTableProvisionedWriteCapacityUnits; /** *

* AutoScaling settings for managing provisioned write capacity for the * global table. *

*/ private AutoScalingSettingsUpdate globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate; /** *

* Represents the settings of a global secondary index for a global table * that will be modified. *

*/ private java.util.List globalTableGlobalSecondaryIndexSettingsUpdate; /** *

* Represents the settings for a global table in a region that will be * modified. *

*/ private java.util.List replicaSettingsUpdate; /** *

* The name of the global table *

*

* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
* * @return

* The name of the global table *

*/ public String getGlobalTableName() { return globalTableName; } /** *

* The name of the global table *

*

* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
* * @param globalTableName

* The name of the global table *

*/ public void setGlobalTableName(String globalTableName) { this.globalTableName = globalTableName; } /** *

* The name of the global table *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 3 - 255
* Pattern: [a-zA-Z0-9_.-]+
* * @param globalTableName

* The name of the global table *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateGlobalTableSettingsRequest withGlobalTableName(String globalTableName) { this.globalTableName = globalTableName; return this; } /** *

* The maximum number of writes consumed per second before DynamoDB returns * a ThrottlingException. *

*

* Constraints:
* Range: 1 -
* * @return

* The maximum number of writes consumed per second before DynamoDB * returns a ThrottlingException. *

*/ public Long getGlobalTableProvisionedWriteCapacityUnits() { return globalTableProvisionedWriteCapacityUnits; } /** *

* The maximum number of writes consumed per second before DynamoDB returns * a ThrottlingException. *

*

* Constraints:
* Range: 1 -
* * @param globalTableProvisionedWriteCapacityUnits

* The maximum number of writes consumed per second before * DynamoDB returns a ThrottlingException. *

*/ public void setGlobalTableProvisionedWriteCapacityUnits( Long globalTableProvisionedWriteCapacityUnits) { this.globalTableProvisionedWriteCapacityUnits = globalTableProvisionedWriteCapacityUnits; } /** *

* The maximum number of writes consumed per second before DynamoDB returns * a ThrottlingException. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 1 -
* * @param globalTableProvisionedWriteCapacityUnits

* The maximum number of writes consumed per second before * DynamoDB returns a ThrottlingException. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateGlobalTableSettingsRequest withGlobalTableProvisionedWriteCapacityUnits( Long globalTableProvisionedWriteCapacityUnits) { this.globalTableProvisionedWriteCapacityUnits = globalTableProvisionedWriteCapacityUnits; return this; } /** *

* AutoScaling settings for managing provisioned write capacity for the * global table. *

* * @return

* AutoScaling settings for managing provisioned write capacity for * the global table. *

*/ public AutoScalingSettingsUpdate getGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate() { return globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate; } /** *

* AutoScaling settings for managing provisioned write capacity for the * global table. *

* * @param globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate

* AutoScaling settings for managing provisioned write capacity * for the global table. *

*/ public void setGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate( AutoScalingSettingsUpdate globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate) { this.globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate = globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate; } /** *

* AutoScaling settings for managing provisioned write capacity for the * global table. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate

* AutoScaling settings for managing provisioned write capacity * for the global table. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateGlobalTableSettingsRequest withGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate( AutoScalingSettingsUpdate globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate) { this.globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate = globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate; return this; } /** *

* Represents the settings of a global secondary index for a global table * that will be modified. *

* * @return

* Represents the settings of a global secondary index for a global * table that will be modified. *

*/ public java.util.List getGlobalTableGlobalSecondaryIndexSettingsUpdate() { return globalTableGlobalSecondaryIndexSettingsUpdate; } /** *

* Represents the settings of a global secondary index for a global table * that will be modified. *

* * @param globalTableGlobalSecondaryIndexSettingsUpdate

* Represents the settings of a global secondary index for a * global table that will be modified. *

*/ public void setGlobalTableGlobalSecondaryIndexSettingsUpdate( java.util.Collection globalTableGlobalSecondaryIndexSettingsUpdate) { if (globalTableGlobalSecondaryIndexSettingsUpdate == null) { this.globalTableGlobalSecondaryIndexSettingsUpdate = null; return; } this.globalTableGlobalSecondaryIndexSettingsUpdate = new java.util.ArrayList( globalTableGlobalSecondaryIndexSettingsUpdate); } /** *

* Represents the settings of a global secondary index for a global table * that will be modified. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param globalTableGlobalSecondaryIndexSettingsUpdate

* Represents the settings of a global secondary index for a * global table that will be modified. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateGlobalTableSettingsRequest withGlobalTableGlobalSecondaryIndexSettingsUpdate( GlobalTableGlobalSecondaryIndexSettingsUpdate... globalTableGlobalSecondaryIndexSettingsUpdate) { if (getGlobalTableGlobalSecondaryIndexSettingsUpdate() == null) { this.globalTableGlobalSecondaryIndexSettingsUpdate = new java.util.ArrayList( globalTableGlobalSecondaryIndexSettingsUpdate.length); } for (GlobalTableGlobalSecondaryIndexSettingsUpdate value : globalTableGlobalSecondaryIndexSettingsUpdate) { this.globalTableGlobalSecondaryIndexSettingsUpdate.add(value); } return this; } /** *

* Represents the settings of a global secondary index for a global table * that will be modified. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param globalTableGlobalSecondaryIndexSettingsUpdate

* Represents the settings of a global secondary index for a * global table that will be modified. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateGlobalTableSettingsRequest withGlobalTableGlobalSecondaryIndexSettingsUpdate( java.util.Collection globalTableGlobalSecondaryIndexSettingsUpdate) { setGlobalTableGlobalSecondaryIndexSettingsUpdate(globalTableGlobalSecondaryIndexSettingsUpdate); return this; } /** *

* Represents the settings for a global table in a region that will be * modified. *

* * @return

* Represents the settings for a global table in a region that will * be modified. *

*/ public java.util.List getReplicaSettingsUpdate() { return replicaSettingsUpdate; } /** *

* Represents the settings for a global table in a region that will be * modified. *

* * @param replicaSettingsUpdate

* Represents the settings for a global table in a region that * will be modified. *

*/ public void setReplicaSettingsUpdate( java.util.Collection replicaSettingsUpdate) { if (replicaSettingsUpdate == null) { this.replicaSettingsUpdate = null; return; } this.replicaSettingsUpdate = new java.util.ArrayList( replicaSettingsUpdate); } /** *

* Represents the settings for a global table in a region that will be * modified. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param replicaSettingsUpdate

* Represents the settings for a global table in a region that * will be modified. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateGlobalTableSettingsRequest withReplicaSettingsUpdate( ReplicaSettingsUpdate... replicaSettingsUpdate) { if (getReplicaSettingsUpdate() == null) { this.replicaSettingsUpdate = new java.util.ArrayList( replicaSettingsUpdate.length); } for (ReplicaSettingsUpdate value : replicaSettingsUpdate) { this.replicaSettingsUpdate.add(value); } return this; } /** *

* Represents the settings for a global table in a region that will be * modified. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param replicaSettingsUpdate

* Represents the settings for a global table in a region that * will be modified. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateGlobalTableSettingsRequest withReplicaSettingsUpdate( java.util.Collection replicaSettingsUpdate) { setReplicaSettingsUpdate(replicaSettingsUpdate); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getGlobalTableName() != null) sb.append("GlobalTableName: " + getGlobalTableName() + ","); if (getGlobalTableProvisionedWriteCapacityUnits() != null) sb.append("GlobalTableProvisionedWriteCapacityUnits: " + getGlobalTableProvisionedWriteCapacityUnits() + ","); if (getGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate() != null) sb.append("GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate: " + getGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate() + ","); if (getGlobalTableGlobalSecondaryIndexSettingsUpdate() != null) sb.append("GlobalTableGlobalSecondaryIndexSettingsUpdate: " + getGlobalTableGlobalSecondaryIndexSettingsUpdate() + ","); if (getReplicaSettingsUpdate() != null) sb.append("ReplicaSettingsUpdate: " + getReplicaSettingsUpdate()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getGlobalTableName() == null) ? 0 : getGlobalTableName().hashCode()); hashCode = prime * hashCode + ((getGlobalTableProvisionedWriteCapacityUnits() == null) ? 0 : getGlobalTableProvisionedWriteCapacityUnits().hashCode()); hashCode = prime * hashCode + ((getGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate() == null) ? 0 : getGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate() .hashCode()); hashCode = prime * hashCode + ((getGlobalTableGlobalSecondaryIndexSettingsUpdate() == null) ? 0 : getGlobalTableGlobalSecondaryIndexSettingsUpdate().hashCode()); hashCode = prime * hashCode + ((getReplicaSettingsUpdate() == null) ? 0 : getReplicaSettingsUpdate().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateGlobalTableSettingsRequest == false) return false; UpdateGlobalTableSettingsRequest other = (UpdateGlobalTableSettingsRequest) obj; if (other.getGlobalTableName() == null ^ this.getGlobalTableName() == null) return false; if (other.getGlobalTableName() != null && other.getGlobalTableName().equals(this.getGlobalTableName()) == false) return false; if (other.getGlobalTableProvisionedWriteCapacityUnits() == null ^ this.getGlobalTableProvisionedWriteCapacityUnits() == null) return false; if (other.getGlobalTableProvisionedWriteCapacityUnits() != null && other.getGlobalTableProvisionedWriteCapacityUnits().equals( this.getGlobalTableProvisionedWriteCapacityUnits()) == false) return false; if (other.getGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate() == null ^ this.getGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate() == null) return false; if (other.getGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate() != null && other.getGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate().equals( this.getGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate()) == false) return false; if (other.getGlobalTableGlobalSecondaryIndexSettingsUpdate() == null ^ this.getGlobalTableGlobalSecondaryIndexSettingsUpdate() == null) return false; if (other.getGlobalTableGlobalSecondaryIndexSettingsUpdate() != null && other.getGlobalTableGlobalSecondaryIndexSettingsUpdate().equals( this.getGlobalTableGlobalSecondaryIndexSettingsUpdate()) == false) return false; if (other.getReplicaSettingsUpdate() == null ^ this.getReplicaSettingsUpdate() == null) return false; if (other.getReplicaSettingsUpdate() != null && other.getReplicaSettingsUpdate().equals(this.getReplicaSettingsUpdate()) == false) return false; return true; } }