/* * 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; /** *

* Represents the properties of a replica. *

*/ public class ReplicaSettingsDescription implements Serializable { /** *

* The region name of the replica. *

*/ private String regionName; /** *

* The current state of the region: *

* *

* Constraints:
* Allowed Values: CREATING, UPDATING, DELETING, ACTIVE */ private String replicaStatus; /** *

* The maximum number of strongly consistent reads consumed per second * before DynamoDB returns a ThrottlingException. For more * information, see Specifying Read and Write Requirements in the Amazon DynamoDB * Developer Guide. *

*

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

* Autoscaling settings for a global table replica's read capacity units. *

*/ private AutoScalingSettingsDescription replicaProvisionedReadCapacityAutoScalingSettings; /** *

* The maximum number of writes consumed per second before DynamoDB returns * a ThrottlingException. For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB * Developer Guide. *

*

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

* AutoScaling settings for a global table replica's write capacity units. *

*/ private AutoScalingSettingsDescription replicaProvisionedWriteCapacityAutoScalingSettings; /** *

* Replica global secondary index settings for the global table. *

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

* The region name of the replica. *

* * @return

* The region name of the replica. *

*/ public String getRegionName() { return regionName; } /** *

* The region name of the replica. *

* * @param regionName

* The region name of the replica. *

*/ public void setRegionName(String regionName) { this.regionName = regionName; } /** *

* The region name of the replica. *

*

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

* The region name of the replica. *

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

* The current state of the region: *

* *

* Constraints:
* Allowed Values: CREATING, UPDATING, DELETING, ACTIVE * * @return

* The current state of the region: *

* * @see ReplicaStatus */ public String getReplicaStatus() { return replicaStatus; } /** *

* The current state of the region: *

* *

* Constraints:
* Allowed Values: CREATING, UPDATING, DELETING, ACTIVE * * @param replicaStatus

* The current state of the region: *

* * @see ReplicaStatus */ public void setReplicaStatus(String replicaStatus) { this.replicaStatus = replicaStatus; } /** *

* The current state of the region: *

* *

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

* Constraints:
* Allowed Values: CREATING, UPDATING, DELETING, ACTIVE * * @param replicaStatus

* The current state of the region: *

* * @return A reference to this updated object so that method calls can be * chained together. * @see ReplicaStatus */ public ReplicaSettingsDescription withReplicaStatus(String replicaStatus) { this.replicaStatus = replicaStatus; return this; } /** *

* The current state of the region: *

* *

* Constraints:
* Allowed Values: CREATING, UPDATING, DELETING, ACTIVE * * @param replicaStatus

* The current state of the region: *

* * @see ReplicaStatus */ public void setReplicaStatus(ReplicaStatus replicaStatus) { this.replicaStatus = replicaStatus.toString(); } /** *

* The current state of the region: *

* *

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

* Constraints:
* Allowed Values: CREATING, UPDATING, DELETING, ACTIVE * * @param replicaStatus

* The current state of the region: *

* * @return A reference to this updated object so that method calls can be * chained together. * @see ReplicaStatus */ public ReplicaSettingsDescription withReplicaStatus(ReplicaStatus replicaStatus) { this.replicaStatus = replicaStatus.toString(); return this; } /** *

* The maximum number of strongly consistent reads consumed per second * before DynamoDB returns a ThrottlingException. For more * information, see Specifying Read and Write Requirements in the Amazon DynamoDB * Developer Guide. *

*

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

* The maximum number of strongly consistent reads consumed per * second before DynamoDB returns a ThrottlingException * . For more information, see Specifying Read and Write Requirements in the Amazon * DynamoDB Developer Guide. *

*/ public Long getReplicaProvisionedReadCapacityUnits() { return replicaProvisionedReadCapacityUnits; } /** *

* The maximum number of strongly consistent reads consumed per second * before DynamoDB returns a ThrottlingException. For more * information, see Specifying Read and Write Requirements in the Amazon DynamoDB * Developer Guide. *

*

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

* The maximum number of strongly consistent reads consumed per * second before DynamoDB returns a * ThrottlingException. For more information, see Specifying Read and Write Requirements in the Amazon * DynamoDB Developer Guide. *

*/ public void setReplicaProvisionedReadCapacityUnits(Long replicaProvisionedReadCapacityUnits) { this.replicaProvisionedReadCapacityUnits = replicaProvisionedReadCapacityUnits; } /** *

* The maximum number of strongly consistent reads consumed per second * before DynamoDB returns a ThrottlingException. For more * information, see Specifying Read and Write Requirements in the Amazon DynamoDB * Developer Guide. *

*

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

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

* The maximum number of strongly consistent reads consumed per * second before DynamoDB returns a * ThrottlingException. For more information, see Specifying Read and Write Requirements in the Amazon * DynamoDB Developer Guide. *

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

* Autoscaling settings for a global table replica's read capacity units. *

* * @return

* Autoscaling settings for a global table replica's read capacity * units. *

*/ public AutoScalingSettingsDescription getReplicaProvisionedReadCapacityAutoScalingSettings() { return replicaProvisionedReadCapacityAutoScalingSettings; } /** *

* Autoscaling settings for a global table replica's read capacity units. *

* * @param replicaProvisionedReadCapacityAutoScalingSettings

* Autoscaling settings for a global table replica's read * capacity units. *

*/ public void setReplicaProvisionedReadCapacityAutoScalingSettings( AutoScalingSettingsDescription replicaProvisionedReadCapacityAutoScalingSettings) { this.replicaProvisionedReadCapacityAutoScalingSettings = replicaProvisionedReadCapacityAutoScalingSettings; } /** *

* Autoscaling settings for a global table replica's read capacity units. *

*

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

* Autoscaling settings for a global table replica's read * capacity units. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ReplicaSettingsDescription withReplicaProvisionedReadCapacityAutoScalingSettings( AutoScalingSettingsDescription replicaProvisionedReadCapacityAutoScalingSettings) { this.replicaProvisionedReadCapacityAutoScalingSettings = replicaProvisionedReadCapacityAutoScalingSettings; return this; } /** *

* The maximum number of writes consumed per second before DynamoDB returns * a ThrottlingException. For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB * Developer Guide. *

*

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

* The maximum number of writes consumed per second before DynamoDB * returns a ThrottlingException. For more information, * see Specifying Read and Write Requirements in the Amazon * DynamoDB Developer Guide. *

*/ public Long getReplicaProvisionedWriteCapacityUnits() { return replicaProvisionedWriteCapacityUnits; } /** *

* The maximum number of writes consumed per second before DynamoDB returns * a ThrottlingException. For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB * Developer Guide. *

*

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

* The maximum number of writes consumed per second before * DynamoDB returns a ThrottlingException. For more * information, see Specifying Read and Write Requirements in the Amazon * DynamoDB Developer Guide. *

*/ public void setReplicaProvisionedWriteCapacityUnits(Long replicaProvisionedWriteCapacityUnits) { this.replicaProvisionedWriteCapacityUnits = replicaProvisionedWriteCapacityUnits; } /** *

* The maximum number of writes consumed per second before DynamoDB returns * a ThrottlingException. For more information, see Specifying Read and Write Requirements in the Amazon DynamoDB * Developer Guide. *

*

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

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

* The maximum number of writes consumed per second before * DynamoDB returns a ThrottlingException. For more * information, see Specifying Read and Write Requirements in the Amazon * DynamoDB Developer Guide. *

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

* AutoScaling settings for a global table replica's write capacity units. *

* * @return

* AutoScaling settings for a global table replica's write capacity * units. *

*/ public AutoScalingSettingsDescription getReplicaProvisionedWriteCapacityAutoScalingSettings() { return replicaProvisionedWriteCapacityAutoScalingSettings; } /** *

* AutoScaling settings for a global table replica's write capacity units. *

* * @param replicaProvisionedWriteCapacityAutoScalingSettings

* AutoScaling settings for a global table replica's write * capacity units. *

*/ public void setReplicaProvisionedWriteCapacityAutoScalingSettings( AutoScalingSettingsDescription replicaProvisionedWriteCapacityAutoScalingSettings) { this.replicaProvisionedWriteCapacityAutoScalingSettings = replicaProvisionedWriteCapacityAutoScalingSettings; } /** *

* AutoScaling settings for a global table replica's write capacity units. *

*

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

* AutoScaling settings for a global table replica's write * capacity units. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ReplicaSettingsDescription withReplicaProvisionedWriteCapacityAutoScalingSettings( AutoScalingSettingsDescription replicaProvisionedWriteCapacityAutoScalingSettings) { this.replicaProvisionedWriteCapacityAutoScalingSettings = replicaProvisionedWriteCapacityAutoScalingSettings; return this; } /** *

* Replica global secondary index settings for the global table. *

* * @return

* Replica global secondary index settings for the global table. *

*/ public java.util.List getReplicaGlobalSecondaryIndexSettings() { return replicaGlobalSecondaryIndexSettings; } /** *

* Replica global secondary index settings for the global table. *

* * @param replicaGlobalSecondaryIndexSettings

* Replica global secondary index settings for the global table. *

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

* Replica global secondary index settings for the global table. *

*

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

* Replica global secondary index settings for the global table. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ReplicaSettingsDescription withReplicaGlobalSecondaryIndexSettings( ReplicaGlobalSecondaryIndexSettingsDescription... replicaGlobalSecondaryIndexSettings) { if (getReplicaGlobalSecondaryIndexSettings() == null) { this.replicaGlobalSecondaryIndexSettings = new java.util.ArrayList( replicaGlobalSecondaryIndexSettings.length); } for (ReplicaGlobalSecondaryIndexSettingsDescription value : replicaGlobalSecondaryIndexSettings) { this.replicaGlobalSecondaryIndexSettings.add(value); } return this; } /** *

* Replica global secondary index settings for the global table. *

*

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

* Replica global secondary index settings for the global table. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ReplicaSettingsDescription withReplicaGlobalSecondaryIndexSettings( java.util.Collection replicaGlobalSecondaryIndexSettings) { setReplicaGlobalSecondaryIndexSettings(replicaGlobalSecondaryIndexSettings); 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 (getRegionName() != null) sb.append("RegionName: " + getRegionName() + ","); if (getReplicaStatus() != null) sb.append("ReplicaStatus: " + getReplicaStatus() + ","); if (getReplicaProvisionedReadCapacityUnits() != null) sb.append("ReplicaProvisionedReadCapacityUnits: " + getReplicaProvisionedReadCapacityUnits() + ","); if (getReplicaProvisionedReadCapacityAutoScalingSettings() != null) sb.append("ReplicaProvisionedReadCapacityAutoScalingSettings: " + getReplicaProvisionedReadCapacityAutoScalingSettings() + ","); if (getReplicaProvisionedWriteCapacityUnits() != null) sb.append("ReplicaProvisionedWriteCapacityUnits: " + getReplicaProvisionedWriteCapacityUnits() + ","); if (getReplicaProvisionedWriteCapacityAutoScalingSettings() != null) sb.append("ReplicaProvisionedWriteCapacityAutoScalingSettings: " + getReplicaProvisionedWriteCapacityAutoScalingSettings() + ","); if (getReplicaGlobalSecondaryIndexSettings() != null) sb.append("ReplicaGlobalSecondaryIndexSettings: " + getReplicaGlobalSecondaryIndexSettings()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRegionName() == null) ? 0 : getRegionName().hashCode()); hashCode = prime * hashCode + ((getReplicaStatus() == null) ? 0 : getReplicaStatus().hashCode()); hashCode = prime * hashCode + ((getReplicaProvisionedReadCapacityUnits() == null) ? 0 : getReplicaProvisionedReadCapacityUnits().hashCode()); hashCode = prime * hashCode + ((getReplicaProvisionedReadCapacityAutoScalingSettings() == null) ? 0 : getReplicaProvisionedReadCapacityAutoScalingSettings().hashCode()); hashCode = prime * hashCode + ((getReplicaProvisionedWriteCapacityUnits() == null) ? 0 : getReplicaProvisionedWriteCapacityUnits().hashCode()); hashCode = prime * hashCode + ((getReplicaProvisionedWriteCapacityAutoScalingSettings() == null) ? 0 : getReplicaProvisionedWriteCapacityAutoScalingSettings().hashCode()); hashCode = prime * hashCode + ((getReplicaGlobalSecondaryIndexSettings() == null) ? 0 : getReplicaGlobalSecondaryIndexSettings().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ReplicaSettingsDescription == false) return false; ReplicaSettingsDescription other = (ReplicaSettingsDescription) obj; if (other.getRegionName() == null ^ this.getRegionName() == null) return false; if (other.getRegionName() != null && other.getRegionName().equals(this.getRegionName()) == false) return false; if (other.getReplicaStatus() == null ^ this.getReplicaStatus() == null) return false; if (other.getReplicaStatus() != null && other.getReplicaStatus().equals(this.getReplicaStatus()) == false) return false; if (other.getReplicaProvisionedReadCapacityUnits() == null ^ this.getReplicaProvisionedReadCapacityUnits() == null) return false; if (other.getReplicaProvisionedReadCapacityUnits() != null && other.getReplicaProvisionedReadCapacityUnits().equals( this.getReplicaProvisionedReadCapacityUnits()) == false) return false; if (other.getReplicaProvisionedReadCapacityAutoScalingSettings() == null ^ this.getReplicaProvisionedReadCapacityAutoScalingSettings() == null) return false; if (other.getReplicaProvisionedReadCapacityAutoScalingSettings() != null && other.getReplicaProvisionedReadCapacityAutoScalingSettings().equals( this.getReplicaProvisionedReadCapacityAutoScalingSettings()) == false) return false; if (other.getReplicaProvisionedWriteCapacityUnits() == null ^ this.getReplicaProvisionedWriteCapacityUnits() == null) return false; if (other.getReplicaProvisionedWriteCapacityUnits() != null && other.getReplicaProvisionedWriteCapacityUnits().equals( this.getReplicaProvisionedWriteCapacityUnits()) == false) return false; if (other.getReplicaProvisionedWriteCapacityAutoScalingSettings() == null ^ this.getReplicaProvisionedWriteCapacityAutoScalingSettings() == null) return false; if (other.getReplicaProvisionedWriteCapacityAutoScalingSettings() != null && other.getReplicaProvisionedWriteCapacityAutoScalingSettings().equals( this.getReplicaProvisionedWriteCapacityAutoScalingSettings()) == false) return false; if (other.getReplicaGlobalSecondaryIndexSettings() == null ^ this.getReplicaGlobalSecondaryIndexSettings() == null) return false; if (other.getReplicaGlobalSecondaryIndexSettings() != null && other.getReplicaGlobalSecondaryIndexSettings().equals( this.getReplicaGlobalSecondaryIndexSettings()) == false) return false; return true; } }