/* * 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 autoscaling settings for a global table or global secondary * index. *

*/ public class AutoScalingSettingsDescription implements Serializable { /** *

* The minimum capacity units that a global table or global secondary index * should be scaled down to. *

*

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

* The maximum capacity units that a global table or global secondary index * should be scaled up to. *

*

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

* Disabled autoscaling for this global table or global secondary index. *

*/ private Boolean autoScalingDisabled; /** *

* Role ARN used for configuring autoScaling policy. *

*/ private String autoScalingRoleArn; /** *

* Information about the scaling policies. *

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

* The minimum capacity units that a global table or global secondary index * should be scaled down to. *

*

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

* The minimum capacity units that a global table or global * secondary index should be scaled down to. *

*/ public Long getMinimumUnits() { return minimumUnits; } /** *

* The minimum capacity units that a global table or global secondary index * should be scaled down to. *

*

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

* The minimum capacity units that a global table or global * secondary index should be scaled down to. *

*/ public void setMinimumUnits(Long minimumUnits) { this.minimumUnits = minimumUnits; } /** *

* The minimum capacity units that a global table or global secondary index * should be scaled down to. *

*

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

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

* The minimum capacity units that a global table or global * secondary index should be scaled down to. *

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

* The maximum capacity units that a global table or global secondary index * should be scaled up to. *

*

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

* The maximum capacity units that a global table or global * secondary index should be scaled up to. *

*/ public Long getMaximumUnits() { return maximumUnits; } /** *

* The maximum capacity units that a global table or global secondary index * should be scaled up to. *

*

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

* The maximum capacity units that a global table or global * secondary index should be scaled up to. *

*/ public void setMaximumUnits(Long maximumUnits) { this.maximumUnits = maximumUnits; } /** *

* The maximum capacity units that a global table or global secondary index * should be scaled up to. *

*

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

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

* The maximum capacity units that a global table or global * secondary index should be scaled up to. *

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

* Disabled autoscaling for this global table or global secondary index. *

* * @return

* Disabled autoscaling for this global table or global secondary * index. *

*/ public Boolean isAutoScalingDisabled() { return autoScalingDisabled; } /** *

* Disabled autoscaling for this global table or global secondary index. *

* * @return

* Disabled autoscaling for this global table or global secondary * index. *

*/ public Boolean getAutoScalingDisabled() { return autoScalingDisabled; } /** *

* Disabled autoscaling for this global table or global secondary index. *

* * @param autoScalingDisabled

* Disabled autoscaling for this global table or global secondary * index. *

*/ public void setAutoScalingDisabled(Boolean autoScalingDisabled) { this.autoScalingDisabled = autoScalingDisabled; } /** *

* Disabled autoscaling for this global table or global secondary index. *

*

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

* Disabled autoscaling for this global table or global secondary * index. *

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

* Role ARN used for configuring autoScaling policy. *

* * @return

* Role ARN used for configuring autoScaling policy. *

*/ public String getAutoScalingRoleArn() { return autoScalingRoleArn; } /** *

* Role ARN used for configuring autoScaling policy. *

* * @param autoScalingRoleArn

* Role ARN used for configuring autoScaling policy. *

*/ public void setAutoScalingRoleArn(String autoScalingRoleArn) { this.autoScalingRoleArn = autoScalingRoleArn; } /** *

* Role ARN used for configuring autoScaling policy. *

*

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

* Role ARN used for configuring autoScaling policy. *

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

* Information about the scaling policies. *

* * @return

* Information about the scaling policies. *

*/ public java.util.List getScalingPolicies() { return scalingPolicies; } /** *

* Information about the scaling policies. *

* * @param scalingPolicies

* Information about the scaling policies. *

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

* Information about the scaling policies. *

*

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

* Information about the scaling policies. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AutoScalingSettingsDescription withScalingPolicies( AutoScalingPolicyDescription... scalingPolicies) { if (getScalingPolicies() == null) { this.scalingPolicies = new java.util.ArrayList( scalingPolicies.length); } for (AutoScalingPolicyDescription value : scalingPolicies) { this.scalingPolicies.add(value); } return this; } /** *

* Information about the scaling policies. *

*

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

* Information about the scaling policies. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AutoScalingSettingsDescription withScalingPolicies( java.util.Collection scalingPolicies) { setScalingPolicies(scalingPolicies); 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 (getMinimumUnits() != null) sb.append("MinimumUnits: " + getMinimumUnits() + ","); if (getMaximumUnits() != null) sb.append("MaximumUnits: " + getMaximumUnits() + ","); if (getAutoScalingDisabled() != null) sb.append("AutoScalingDisabled: " + getAutoScalingDisabled() + ","); if (getAutoScalingRoleArn() != null) sb.append("AutoScalingRoleArn: " + getAutoScalingRoleArn() + ","); if (getScalingPolicies() != null) sb.append("ScalingPolicies: " + getScalingPolicies()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMinimumUnits() == null) ? 0 : getMinimumUnits().hashCode()); hashCode = prime * hashCode + ((getMaximumUnits() == null) ? 0 : getMaximumUnits().hashCode()); hashCode = prime * hashCode + ((getAutoScalingDisabled() == null) ? 0 : getAutoScalingDisabled().hashCode()); hashCode = prime * hashCode + ((getAutoScalingRoleArn() == null) ? 0 : getAutoScalingRoleArn().hashCode()); hashCode = prime * hashCode + ((getScalingPolicies() == null) ? 0 : getScalingPolicies().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AutoScalingSettingsDescription == false) return false; AutoScalingSettingsDescription other = (AutoScalingSettingsDescription) obj; if (other.getMinimumUnits() == null ^ this.getMinimumUnits() == null) return false; if (other.getMinimumUnits() != null && other.getMinimumUnits().equals(this.getMinimumUnits()) == false) return false; if (other.getMaximumUnits() == null ^ this.getMaximumUnits() == null) return false; if (other.getMaximumUnits() != null && other.getMaximumUnits().equals(this.getMaximumUnits()) == false) return false; if (other.getAutoScalingDisabled() == null ^ this.getAutoScalingDisabled() == null) return false; if (other.getAutoScalingDisabled() != null && other.getAutoScalingDisabled().equals(this.getAutoScalingDisabled()) == false) return false; if (other.getAutoScalingRoleArn() == null ^ this.getAutoScalingRoleArn() == null) return false; if (other.getAutoScalingRoleArn() != null && other.getAutoScalingRoleArn().equals(this.getAutoScalingRoleArn()) == false) return false; if (other.getScalingPolicies() == null ^ this.getScalingPolicies() == null) return false; if (other.getScalingPolicies() != null && other.getScalingPolicies().equals(this.getScalingPolicies()) == false) return false; return true; } }