com.amazonaws.services.memorydb.model.ClusterConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-memorydb 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.memorydb.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A list of cluster configuration options.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ClusterConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the cluster
*
*/
private String name;
/**
*
* The description of the cluster configuration
*
*/
private String description;
/**
*
* The node type used for the cluster
*
*/
private String nodeType;
/**
*
* The Redis OSS engine version used by the cluster
*
*/
private String engineVersion;
/**
*
* The specified maintenance window for the cluster
*
*/
private String maintenanceWindow;
/**
*
* The Amazon Resource Name (ARN) of the SNS notification topic for the cluster
*
*/
private String topicArn;
/**
*
* The port used by the cluster
*
*/
private Integer port;
/**
*
* The name of parameter group used by the cluster
*
*/
private String parameterGroupName;
/**
*
* The name of the subnet group used by the cluster
*
*/
private String subnetGroupName;
/**
*
* The ID of the VPC the cluster belongs to
*
*/
private String vpcId;
/**
*
* The snapshot retention limit set by the cluster
*
*/
private Integer snapshotRetentionLimit;
/**
*
* The snapshot window set by the cluster
*
*/
private String snapshotWindow;
/**
*
* The number of shards in the cluster
*
*/
private Integer numShards;
/**
*
* The list of shards in the cluster
*
*/
private java.util.List shards;
/**
*
* The name of the cluster
*
*
* @param name
* The name of the cluster
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the cluster
*
*
* @return The name of the cluster
*/
public String getName() {
return this.name;
}
/**
*
* The name of the cluster
*
*
* @param name
* The name of the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withName(String name) {
setName(name);
return this;
}
/**
*
* The description of the cluster configuration
*
*
* @param description
* The description of the cluster configuration
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The description of the cluster configuration
*
*
* @return The description of the cluster configuration
*/
public String getDescription() {
return this.description;
}
/**
*
* The description of the cluster configuration
*
*
* @param description
* The description of the cluster configuration
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The node type used for the cluster
*
*
* @param nodeType
* The node type used for the cluster
*/
public void setNodeType(String nodeType) {
this.nodeType = nodeType;
}
/**
*
* The node type used for the cluster
*
*
* @return The node type used for the cluster
*/
public String getNodeType() {
return this.nodeType;
}
/**
*
* The node type used for the cluster
*
*
* @param nodeType
* The node type used for the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withNodeType(String nodeType) {
setNodeType(nodeType);
return this;
}
/**
*
* The Redis OSS engine version used by the cluster
*
*
* @param engineVersion
* The Redis OSS engine version used by the cluster
*/
public void setEngineVersion(String engineVersion) {
this.engineVersion = engineVersion;
}
/**
*
* The Redis OSS engine version used by the cluster
*
*
* @return The Redis OSS engine version used by the cluster
*/
public String getEngineVersion() {
return this.engineVersion;
}
/**
*
* The Redis OSS engine version used by the cluster
*
*
* @param engineVersion
* The Redis OSS engine version used by the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withEngineVersion(String engineVersion) {
setEngineVersion(engineVersion);
return this;
}
/**
*
* The specified maintenance window for the cluster
*
*
* @param maintenanceWindow
* The specified maintenance window for the cluster
*/
public void setMaintenanceWindow(String maintenanceWindow) {
this.maintenanceWindow = maintenanceWindow;
}
/**
*
* The specified maintenance window for the cluster
*
*
* @return The specified maintenance window for the cluster
*/
public String getMaintenanceWindow() {
return this.maintenanceWindow;
}
/**
*
* The specified maintenance window for the cluster
*
*
* @param maintenanceWindow
* The specified maintenance window for the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withMaintenanceWindow(String maintenanceWindow) {
setMaintenanceWindow(maintenanceWindow);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the SNS notification topic for the cluster
*
*
* @param topicArn
* The Amazon Resource Name (ARN) of the SNS notification topic for the cluster
*/
public void setTopicArn(String topicArn) {
this.topicArn = topicArn;
}
/**
*
* The Amazon Resource Name (ARN) of the SNS notification topic for the cluster
*
*
* @return The Amazon Resource Name (ARN) of the SNS notification topic for the cluster
*/
public String getTopicArn() {
return this.topicArn;
}
/**
*
* The Amazon Resource Name (ARN) of the SNS notification topic for the cluster
*
*
* @param topicArn
* The Amazon Resource Name (ARN) of the SNS notification topic for the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withTopicArn(String topicArn) {
setTopicArn(topicArn);
return this;
}
/**
*
* The port used by the cluster
*
*
* @param port
* The port used by the cluster
*/
public void setPort(Integer port) {
this.port = port;
}
/**
*
* The port used by the cluster
*
*
* @return The port used by the cluster
*/
public Integer getPort() {
return this.port;
}
/**
*
* The port used by the cluster
*
*
* @param port
* The port used by the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withPort(Integer port) {
setPort(port);
return this;
}
/**
*
* The name of parameter group used by the cluster
*
*
* @param parameterGroupName
* The name of parameter group used by the cluster
*/
public void setParameterGroupName(String parameterGroupName) {
this.parameterGroupName = parameterGroupName;
}
/**
*
* The name of parameter group used by the cluster
*
*
* @return The name of parameter group used by the cluster
*/
public String getParameterGroupName() {
return this.parameterGroupName;
}
/**
*
* The name of parameter group used by the cluster
*
*
* @param parameterGroupName
* The name of parameter group used by the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withParameterGroupName(String parameterGroupName) {
setParameterGroupName(parameterGroupName);
return this;
}
/**
*
* The name of the subnet group used by the cluster
*
*
* @param subnetGroupName
* The name of the subnet group used by the cluster
*/
public void setSubnetGroupName(String subnetGroupName) {
this.subnetGroupName = subnetGroupName;
}
/**
*
* The name of the subnet group used by the cluster
*
*
* @return The name of the subnet group used by the cluster
*/
public String getSubnetGroupName() {
return this.subnetGroupName;
}
/**
*
* The name of the subnet group used by the cluster
*
*
* @param subnetGroupName
* The name of the subnet group used by the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withSubnetGroupName(String subnetGroupName) {
setSubnetGroupName(subnetGroupName);
return this;
}
/**
*
* The ID of the VPC the cluster belongs to
*
*
* @param vpcId
* The ID of the VPC the cluster belongs to
*/
public void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
/**
*
* The ID of the VPC the cluster belongs to
*
*
* @return The ID of the VPC the cluster belongs to
*/
public String getVpcId() {
return this.vpcId;
}
/**
*
* The ID of the VPC the cluster belongs to
*
*
* @param vpcId
* The ID of the VPC the cluster belongs to
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withVpcId(String vpcId) {
setVpcId(vpcId);
return this;
}
/**
*
* The snapshot retention limit set by the cluster
*
*
* @param snapshotRetentionLimit
* The snapshot retention limit set by the cluster
*/
public void setSnapshotRetentionLimit(Integer snapshotRetentionLimit) {
this.snapshotRetentionLimit = snapshotRetentionLimit;
}
/**
*
* The snapshot retention limit set by the cluster
*
*
* @return The snapshot retention limit set by the cluster
*/
public Integer getSnapshotRetentionLimit() {
return this.snapshotRetentionLimit;
}
/**
*
* The snapshot retention limit set by the cluster
*
*
* @param snapshotRetentionLimit
* The snapshot retention limit set by the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withSnapshotRetentionLimit(Integer snapshotRetentionLimit) {
setSnapshotRetentionLimit(snapshotRetentionLimit);
return this;
}
/**
*
* The snapshot window set by the cluster
*
*
* @param snapshotWindow
* The snapshot window set by the cluster
*/
public void setSnapshotWindow(String snapshotWindow) {
this.snapshotWindow = snapshotWindow;
}
/**
*
* The snapshot window set by the cluster
*
*
* @return The snapshot window set by the cluster
*/
public String getSnapshotWindow() {
return this.snapshotWindow;
}
/**
*
* The snapshot window set by the cluster
*
*
* @param snapshotWindow
* The snapshot window set by the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withSnapshotWindow(String snapshotWindow) {
setSnapshotWindow(snapshotWindow);
return this;
}
/**
*
* The number of shards in the cluster
*
*
* @param numShards
* The number of shards in the cluster
*/
public void setNumShards(Integer numShards) {
this.numShards = numShards;
}
/**
*
* The number of shards in the cluster
*
*
* @return The number of shards in the cluster
*/
public Integer getNumShards() {
return this.numShards;
}
/**
*
* The number of shards in the cluster
*
*
* @param numShards
* The number of shards in the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withNumShards(Integer numShards) {
setNumShards(numShards);
return this;
}
/**
*
* The list of shards in the cluster
*
*
* @return The list of shards in the cluster
*/
public java.util.List getShards() {
return shards;
}
/**
*
* The list of shards in the cluster
*
*
* @param shards
* The list of shards in the cluster
*/
public void setShards(java.util.Collection shards) {
if (shards == null) {
this.shards = null;
return;
}
this.shards = new java.util.ArrayList(shards);
}
/**
*
* The list of shards in the cluster
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setShards(java.util.Collection)} or {@link #withShards(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param shards
* The list of shards in the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withShards(ShardDetail... shards) {
if (this.shards == null) {
setShards(new java.util.ArrayList(shards.length));
}
for (ShardDetail ele : shards) {
this.shards.add(ele);
}
return this;
}
/**
*
* The list of shards in the cluster
*
*
* @param shards
* The list of shards in the cluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ClusterConfiguration withShards(java.util.Collection shards) {
setShards(shards);
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getNodeType() != null)
sb.append("NodeType: ").append(getNodeType()).append(",");
if (getEngineVersion() != null)
sb.append("EngineVersion: ").append(getEngineVersion()).append(",");
if (getMaintenanceWindow() != null)
sb.append("MaintenanceWindow: ").append(getMaintenanceWindow()).append(",");
if (getTopicArn() != null)
sb.append("TopicArn: ").append(getTopicArn()).append(",");
if (getPort() != null)
sb.append("Port: ").append(getPort()).append(",");
if (getParameterGroupName() != null)
sb.append("ParameterGroupName: ").append(getParameterGroupName()).append(",");
if (getSubnetGroupName() != null)
sb.append("SubnetGroupName: ").append(getSubnetGroupName()).append(",");
if (getVpcId() != null)
sb.append("VpcId: ").append(getVpcId()).append(",");
if (getSnapshotRetentionLimit() != null)
sb.append("SnapshotRetentionLimit: ").append(getSnapshotRetentionLimit()).append(",");
if (getSnapshotWindow() != null)
sb.append("SnapshotWindow: ").append(getSnapshotWindow()).append(",");
if (getNumShards() != null)
sb.append("NumShards: ").append(getNumShards()).append(",");
if (getShards() != null)
sb.append("Shards: ").append(getShards());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ClusterConfiguration == false)
return false;
ClusterConfiguration other = (ClusterConfiguration) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getNodeType() == null ^ this.getNodeType() == null)
return false;
if (other.getNodeType() != null && other.getNodeType().equals(this.getNodeType()) == false)
return false;
if (other.getEngineVersion() == null ^ this.getEngineVersion() == null)
return false;
if (other.getEngineVersion() != null && other.getEngineVersion().equals(this.getEngineVersion()) == false)
return false;
if (other.getMaintenanceWindow() == null ^ this.getMaintenanceWindow() == null)
return false;
if (other.getMaintenanceWindow() != null && other.getMaintenanceWindow().equals(this.getMaintenanceWindow()) == false)
return false;
if (other.getTopicArn() == null ^ this.getTopicArn() == null)
return false;
if (other.getTopicArn() != null && other.getTopicArn().equals(this.getTopicArn()) == false)
return false;
if (other.getPort() == null ^ this.getPort() == null)
return false;
if (other.getPort() != null && other.getPort().equals(this.getPort()) == false)
return false;
if (other.getParameterGroupName() == null ^ this.getParameterGroupName() == null)
return false;
if (other.getParameterGroupName() != null && other.getParameterGroupName().equals(this.getParameterGroupName()) == false)
return false;
if (other.getSubnetGroupName() == null ^ this.getSubnetGroupName() == null)
return false;
if (other.getSubnetGroupName() != null && other.getSubnetGroupName().equals(this.getSubnetGroupName()) == false)
return false;
if (other.getVpcId() == null ^ this.getVpcId() == null)
return false;
if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false)
return false;
if (other.getSnapshotRetentionLimit() == null ^ this.getSnapshotRetentionLimit() == null)
return false;
if (other.getSnapshotRetentionLimit() != null && other.getSnapshotRetentionLimit().equals(this.getSnapshotRetentionLimit()) == false)
return false;
if (other.getSnapshotWindow() == null ^ this.getSnapshotWindow() == null)
return false;
if (other.getSnapshotWindow() != null && other.getSnapshotWindow().equals(this.getSnapshotWindow()) == false)
return false;
if (other.getNumShards() == null ^ this.getNumShards() == null)
return false;
if (other.getNumShards() != null && other.getNumShards().equals(this.getNumShards()) == false)
return false;
if (other.getShards() == null ^ this.getShards() == null)
return false;
if (other.getShards() != null && other.getShards().equals(this.getShards()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getNodeType() == null) ? 0 : getNodeType().hashCode());
hashCode = prime * hashCode + ((getEngineVersion() == null) ? 0 : getEngineVersion().hashCode());
hashCode = prime * hashCode + ((getMaintenanceWindow() == null) ? 0 : getMaintenanceWindow().hashCode());
hashCode = prime * hashCode + ((getTopicArn() == null) ? 0 : getTopicArn().hashCode());
hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode());
hashCode = prime * hashCode + ((getParameterGroupName() == null) ? 0 : getParameterGroupName().hashCode());
hashCode = prime * hashCode + ((getSubnetGroupName() == null) ? 0 : getSubnetGroupName().hashCode());
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode());
hashCode = prime * hashCode + ((getSnapshotRetentionLimit() == null) ? 0 : getSnapshotRetentionLimit().hashCode());
hashCode = prime * hashCode + ((getSnapshotWindow() == null) ? 0 : getSnapshotWindow().hashCode());
hashCode = prime * hashCode + ((getNumShards() == null) ? 0 : getNumShards().hashCode());
hashCode = prime * hashCode + ((getShards() == null) ? 0 : getShards().hashCode());
return hashCode;
}
@Override
public ClusterConfiguration clone() {
try {
return (ClusterConfiguration) 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.memorydb.model.transform.ClusterConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}