
com.amazonaws.services.kafka.model.Cluster Maven / Gradle / Ivy
/*
* 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.kafka.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Returns information about a cluster.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Cluster implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.
*
*/
private String activeOperationArn;
/**
*
* Cluster Type.
*
*/
private String clusterType;
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the cluster.
*
*/
private String clusterArn;
/**
*
* The name of the cluster.
*
*/
private String clusterName;
/**
*
* The time when the cluster was created.
*
*/
private java.util.Date creationTime;
/**
*
* The current version of the MSK cluster.
*
*/
private String currentVersion;
/**
*
* The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE,
* REBOOTING_BROKER, and UPDATING.
*
*/
private String state;
/**
*
* State Info for the Amazon MSK cluster.
*
*/
private StateInfo stateInfo;
/**
*
* Tags attached to the cluster.
*
*/
private java.util.Map tags;
/**
*
* Information about the provisioned cluster.
*
*/
private Provisioned provisioned;
/**
*
* Information about the serverless cluster.
*
*/
private Serverless serverless;
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.
*
*
* @param activeOperationArn
*
* The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.
*
*/
public void setActiveOperationArn(String activeOperationArn) {
this.activeOperationArn = activeOperationArn;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.
*
*
* @return
* The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.
*
*/
public String getActiveOperationArn() {
return this.activeOperationArn;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.
*
*
* @param activeOperationArn
*
* The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Cluster withActiveOperationArn(String activeOperationArn) {
setActiveOperationArn(activeOperationArn);
return this;
}
/**
*
* Cluster Type.
*
*
* @param clusterType
*
* Cluster Type.
*
* @see ClusterType
*/
public void setClusterType(String clusterType) {
this.clusterType = clusterType;
}
/**
*
* Cluster Type.
*
*
* @return
* Cluster Type.
*
* @see ClusterType
*/
public String getClusterType() {
return this.clusterType;
}
/**
*
* Cluster Type.
*
*
* @param clusterType
*
* Cluster Type.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ClusterType
*/
public Cluster withClusterType(String clusterType) {
setClusterType(clusterType);
return this;
}
/**
*
* Cluster Type.
*
*
* @param clusterType
*
* Cluster Type.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ClusterType
*/
public Cluster withClusterType(ClusterType clusterType) {
this.clusterType = clusterType.toString();
return this;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the cluster.
*
*
* @param clusterArn
*
* The Amazon Resource Name (ARN) that uniquely identifies the cluster.
*
*/
public void setClusterArn(String clusterArn) {
this.clusterArn = clusterArn;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the cluster.
*
*
* @return
* The Amazon Resource Name (ARN) that uniquely identifies the cluster.
*
*/
public String getClusterArn() {
return this.clusterArn;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the cluster.
*
*
* @param clusterArn
*
* The Amazon Resource Name (ARN) that uniquely identifies the cluster.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Cluster withClusterArn(String clusterArn) {
setClusterArn(clusterArn);
return this;
}
/**
*
* The name of the cluster.
*
*
* @param clusterName
*
* The name of the cluster.
*
*/
public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
/**
*
* The name of the cluster.
*
*
* @return
* The name of the cluster.
*
*/
public String getClusterName() {
return this.clusterName;
}
/**
*
* The name of the cluster.
*
*
* @param clusterName
*
* The name of the cluster.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Cluster withClusterName(String clusterName) {
setClusterName(clusterName);
return this;
}
/**
*
* The time when the cluster was created.
*
*
* @param creationTime
*
* The time when the cluster was created.
*
*/
public void setCreationTime(java.util.Date creationTime) {
this.creationTime = creationTime;
}
/**
*
* The time when the cluster was created.
*
*
* @return
* The time when the cluster was created.
*
*/
public java.util.Date getCreationTime() {
return this.creationTime;
}
/**
*
* The time when the cluster was created.
*
*
* @param creationTime
*
* The time when the cluster was created.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Cluster withCreationTime(java.util.Date creationTime) {
setCreationTime(creationTime);
return this;
}
/**
*
* The current version of the MSK cluster.
*
*
* @param currentVersion
*
* The current version of the MSK cluster.
*
*/
public void setCurrentVersion(String currentVersion) {
this.currentVersion = currentVersion;
}
/**
*
* The current version of the MSK cluster.
*
*
* @return
* The current version of the MSK cluster.
*
*/
public String getCurrentVersion() {
return this.currentVersion;
}
/**
*
* The current version of the MSK cluster.
*
*
* @param currentVersion
*
* The current version of the MSK cluster.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Cluster withCurrentVersion(String currentVersion) {
setCurrentVersion(currentVersion);
return this;
}
/**
*
* The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE,
* REBOOTING_BROKER, and UPDATING.
*
*
* @param state
*
* The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING,
* MAINTENANCE, REBOOTING_BROKER, and UPDATING.
*
* @see ClusterState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE,
* REBOOTING_BROKER, and UPDATING.
*
*
* @return
* The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING,
* MAINTENANCE, REBOOTING_BROKER, and UPDATING.
*
* @see ClusterState
*/
public String getState() {
return this.state;
}
/**
*
* The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE,
* REBOOTING_BROKER, and UPDATING.
*
*
* @param state
*
* The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING,
* MAINTENANCE, REBOOTING_BROKER, and UPDATING.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ClusterState
*/
public Cluster withState(String state) {
setState(state);
return this;
}
/**
*
* The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE,
* REBOOTING_BROKER, and UPDATING.
*
*
* @param state
*
* The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING,
* MAINTENANCE, REBOOTING_BROKER, and UPDATING.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ClusterState
*/
public Cluster withState(ClusterState state) {
this.state = state.toString();
return this;
}
/**
*
* State Info for the Amazon MSK cluster.
*
*
* @param stateInfo
*
* State Info for the Amazon MSK cluster.
*
*/
public void setStateInfo(StateInfo stateInfo) {
this.stateInfo = stateInfo;
}
/**
*
* State Info for the Amazon MSK cluster.
*
*
* @return
* State Info for the Amazon MSK cluster.
*
*/
public StateInfo getStateInfo() {
return this.stateInfo;
}
/**
*
* State Info for the Amazon MSK cluster.
*
*
* @param stateInfo
*
* State Info for the Amazon MSK cluster.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Cluster withStateInfo(StateInfo stateInfo) {
setStateInfo(stateInfo);
return this;
}
/**
*
* Tags attached to the cluster.
*
*
* @return
* Tags attached to the cluster.
*
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* Tags attached to the cluster.
*
*
* @param tags
*
* Tags attached to the cluster.
*
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* Tags attached to the cluster.
*
*
* @param tags
*
* Tags attached to the cluster.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Cluster withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see Cluster#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public Cluster addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Cluster clearTagsEntries() {
this.tags = null;
return this;
}
/**
*
* Information about the provisioned cluster.
*
*
* @param provisioned
*
* Information about the provisioned cluster.
*
*/
public void setProvisioned(Provisioned provisioned) {
this.provisioned = provisioned;
}
/**
*
* Information about the provisioned cluster.
*
*
* @return
* Information about the provisioned cluster.
*
*/
public Provisioned getProvisioned() {
return this.provisioned;
}
/**
*
* Information about the provisioned cluster.
*
*
* @param provisioned
*
* Information about the provisioned cluster.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Cluster withProvisioned(Provisioned provisioned) {
setProvisioned(provisioned);
return this;
}
/**
*
* Information about the serverless cluster.
*
*
* @param serverless
*
* Information about the serverless cluster.
*
*/
public void setServerless(Serverless serverless) {
this.serverless = serverless;
}
/**
*
* Information about the serverless cluster.
*
*
* @return
* Information about the serverless cluster.
*
*/
public Serverless getServerless() {
return this.serverless;
}
/**
*
* Information about the serverless cluster.
*
*
* @param serverless
*
* Information about the serverless cluster.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Cluster withServerless(Serverless serverless) {
setServerless(serverless);
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 (getActiveOperationArn() != null)
sb.append("ActiveOperationArn: ").append(getActiveOperationArn()).append(",");
if (getClusterType() != null)
sb.append("ClusterType: ").append(getClusterType()).append(",");
if (getClusterArn() != null)
sb.append("ClusterArn: ").append(getClusterArn()).append(",");
if (getClusterName() != null)
sb.append("ClusterName: ").append(getClusterName()).append(",");
if (getCreationTime() != null)
sb.append("CreationTime: ").append(getCreationTime()).append(",");
if (getCurrentVersion() != null)
sb.append("CurrentVersion: ").append(getCurrentVersion()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getStateInfo() != null)
sb.append("StateInfo: ").append(getStateInfo()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getProvisioned() != null)
sb.append("Provisioned: ").append(getProvisioned()).append(",");
if (getServerless() != null)
sb.append("Serverless: ").append(getServerless());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Cluster == false)
return false;
Cluster other = (Cluster) obj;
if (other.getActiveOperationArn() == null ^ this.getActiveOperationArn() == null)
return false;
if (other.getActiveOperationArn() != null && other.getActiveOperationArn().equals(this.getActiveOperationArn()) == false)
return false;
if (other.getClusterType() == null ^ this.getClusterType() == null)
return false;
if (other.getClusterType() != null && other.getClusterType().equals(this.getClusterType()) == false)
return false;
if (other.getClusterArn() == null ^ this.getClusterArn() == null)
return false;
if (other.getClusterArn() != null && other.getClusterArn().equals(this.getClusterArn()) == false)
return false;
if (other.getClusterName() == null ^ this.getClusterName() == null)
return false;
if (other.getClusterName() != null && other.getClusterName().equals(this.getClusterName()) == false)
return false;
if (other.getCreationTime() == null ^ this.getCreationTime() == null)
return false;
if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false)
return false;
if (other.getCurrentVersion() == null ^ this.getCurrentVersion() == null)
return false;
if (other.getCurrentVersion() != null && other.getCurrentVersion().equals(this.getCurrentVersion()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getStateInfo() == null ^ this.getStateInfo() == null)
return false;
if (other.getStateInfo() != null && other.getStateInfo().equals(this.getStateInfo()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getProvisioned() == null ^ this.getProvisioned() == null)
return false;
if (other.getProvisioned() != null && other.getProvisioned().equals(this.getProvisioned()) == false)
return false;
if (other.getServerless() == null ^ this.getServerless() == null)
return false;
if (other.getServerless() != null && other.getServerless().equals(this.getServerless()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getActiveOperationArn() == null) ? 0 : getActiveOperationArn().hashCode());
hashCode = prime * hashCode + ((getClusterType() == null) ? 0 : getClusterType().hashCode());
hashCode = prime * hashCode + ((getClusterArn() == null) ? 0 : getClusterArn().hashCode());
hashCode = prime * hashCode + ((getClusterName() == null) ? 0 : getClusterName().hashCode());
hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
hashCode = prime * hashCode + ((getCurrentVersion() == null) ? 0 : getCurrentVersion().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getStateInfo() == null) ? 0 : getStateInfo().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getProvisioned() == null) ? 0 : getProvisioned().hashCode());
hashCode = prime * hashCode + ((getServerless() == null) ? 0 : getServerless().hashCode());
return hashCode;
}
@Override
public Cluster clone() {
try {
return (Cluster) 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.kafka.model.transform.ClusterMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}