com.amazonaws.services.keyspaces.model.GetKeyspaceResult 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.keyspaces.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetKeyspaceResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The name of the keyspace.
*
*/
private String keyspaceName;
/**
*
* Returns the ARN of the keyspace.
*
*/
private String resourceArn;
/**
*
* Returns the replication strategy of the keyspace. The options are SINGLE_REGION
or
* MULTI_REGION
.
*
*/
private String replicationStrategy;
/**
*
* If the replicationStrategy
of the keyspace is MULTI_REGION
, a list of replication
* Regions is returned.
*
*/
private java.util.List replicationRegions;
/**
*
* The name of the keyspace.
*
*
* @param keyspaceName
* The name of the keyspace.
*/
public void setKeyspaceName(String keyspaceName) {
this.keyspaceName = keyspaceName;
}
/**
*
* The name of the keyspace.
*
*
* @return The name of the keyspace.
*/
public String getKeyspaceName() {
return this.keyspaceName;
}
/**
*
* The name of the keyspace.
*
*
* @param keyspaceName
* The name of the keyspace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetKeyspaceResult withKeyspaceName(String keyspaceName) {
setKeyspaceName(keyspaceName);
return this;
}
/**
*
* Returns the ARN of the keyspace.
*
*
* @param resourceArn
* Returns the ARN of the keyspace.
*/
public void setResourceArn(String resourceArn) {
this.resourceArn = resourceArn;
}
/**
*
* Returns the ARN of the keyspace.
*
*
* @return Returns the ARN of the keyspace.
*/
public String getResourceArn() {
return this.resourceArn;
}
/**
*
* Returns the ARN of the keyspace.
*
*
* @param resourceArn
* Returns the ARN of the keyspace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetKeyspaceResult withResourceArn(String resourceArn) {
setResourceArn(resourceArn);
return this;
}
/**
*
* Returns the replication strategy of the keyspace. The options are SINGLE_REGION
or
* MULTI_REGION
.
*
*
* @param replicationStrategy
* Returns the replication strategy of the keyspace. The options are SINGLE_REGION
or
* MULTI_REGION
.
* @see Rs
*/
public void setReplicationStrategy(String replicationStrategy) {
this.replicationStrategy = replicationStrategy;
}
/**
*
* Returns the replication strategy of the keyspace. The options are SINGLE_REGION
or
* MULTI_REGION
.
*
*
* @return Returns the replication strategy of the keyspace. The options are SINGLE_REGION
or
* MULTI_REGION
.
* @see Rs
*/
public String getReplicationStrategy() {
return this.replicationStrategy;
}
/**
*
* Returns the replication strategy of the keyspace. The options are SINGLE_REGION
or
* MULTI_REGION
.
*
*
* @param replicationStrategy
* Returns the replication strategy of the keyspace. The options are SINGLE_REGION
or
* MULTI_REGION
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Rs
*/
public GetKeyspaceResult withReplicationStrategy(String replicationStrategy) {
setReplicationStrategy(replicationStrategy);
return this;
}
/**
*
* Returns the replication strategy of the keyspace. The options are SINGLE_REGION
or
* MULTI_REGION
.
*
*
* @param replicationStrategy
* Returns the replication strategy of the keyspace. The options are SINGLE_REGION
or
* MULTI_REGION
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Rs
*/
public GetKeyspaceResult withReplicationStrategy(Rs replicationStrategy) {
this.replicationStrategy = replicationStrategy.toString();
return this;
}
/**
*
* If the replicationStrategy
of the keyspace is MULTI_REGION
, a list of replication
* Regions is returned.
*
*
* @return If the replicationStrategy
of the keyspace is MULTI_REGION
, a list of
* replication Regions is returned.
*/
public java.util.List getReplicationRegions() {
return replicationRegions;
}
/**
*
* If the replicationStrategy
of the keyspace is MULTI_REGION
, a list of replication
* Regions is returned.
*
*
* @param replicationRegions
* If the replicationStrategy
of the keyspace is MULTI_REGION
, a list of
* replication Regions is returned.
*/
public void setReplicationRegions(java.util.Collection replicationRegions) {
if (replicationRegions == null) {
this.replicationRegions = null;
return;
}
this.replicationRegions = new java.util.ArrayList(replicationRegions);
}
/**
*
* If the replicationStrategy
of the keyspace is MULTI_REGION
, a list of replication
* Regions is returned.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setReplicationRegions(java.util.Collection)} or {@link #withReplicationRegions(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param replicationRegions
* If the replicationStrategy
of the keyspace is MULTI_REGION
, a list of
* replication Regions is returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetKeyspaceResult withReplicationRegions(String... replicationRegions) {
if (this.replicationRegions == null) {
setReplicationRegions(new java.util.ArrayList(replicationRegions.length));
}
for (String ele : replicationRegions) {
this.replicationRegions.add(ele);
}
return this;
}
/**
*
* If the replicationStrategy
of the keyspace is MULTI_REGION
, a list of replication
* Regions is returned.
*
*
* @param replicationRegions
* If the replicationStrategy
of the keyspace is MULTI_REGION
, a list of
* replication Regions is returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetKeyspaceResult withReplicationRegions(java.util.Collection replicationRegions) {
setReplicationRegions(replicationRegions);
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 (getKeyspaceName() != null)
sb.append("KeyspaceName: ").append(getKeyspaceName()).append(",");
if (getResourceArn() != null)
sb.append("ResourceArn: ").append(getResourceArn()).append(",");
if (getReplicationStrategy() != null)
sb.append("ReplicationStrategy: ").append(getReplicationStrategy()).append(",");
if (getReplicationRegions() != null)
sb.append("ReplicationRegions: ").append(getReplicationRegions());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetKeyspaceResult == false)
return false;
GetKeyspaceResult other = (GetKeyspaceResult) obj;
if (other.getKeyspaceName() == null ^ this.getKeyspaceName() == null)
return false;
if (other.getKeyspaceName() != null && other.getKeyspaceName().equals(this.getKeyspaceName()) == false)
return false;
if (other.getResourceArn() == null ^ this.getResourceArn() == null)
return false;
if (other.getResourceArn() != null && other.getResourceArn().equals(this.getResourceArn()) == false)
return false;
if (other.getReplicationStrategy() == null ^ this.getReplicationStrategy() == null)
return false;
if (other.getReplicationStrategy() != null && other.getReplicationStrategy().equals(this.getReplicationStrategy()) == false)
return false;
if (other.getReplicationRegions() == null ^ this.getReplicationRegions() == null)
return false;
if (other.getReplicationRegions() != null && other.getReplicationRegions().equals(this.getReplicationRegions()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getKeyspaceName() == null) ? 0 : getKeyspaceName().hashCode());
hashCode = prime * hashCode + ((getResourceArn() == null) ? 0 : getResourceArn().hashCode());
hashCode = prime * hashCode + ((getReplicationStrategy() == null) ? 0 : getReplicationStrategy().hashCode());
hashCode = prime * hashCode + ((getReplicationRegions() == null) ? 0 : getReplicationRegions().hashCode());
return hashCode;
}
@Override
public GetKeyspaceResult clone() {
try {
return (GetKeyspaceResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}