com.amazonaws.services.neptune.model.GlobalClusterMember Maven / Gradle / Ivy
Show all versions of aws-java-sdk-neptune 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.neptune.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* A data structure with information about any primary and secondary clusters associated with an Neptune global
* database.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GlobalClusterMember implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) for each Neptune cluster.
*
*/
private String dBClusterArn;
/**
*
* The Amazon Resource Name (ARN) for each read-only secondary cluster associated with the Neptune global database.
*
*/
private java.util.List readers;
/**
*
* Specifies whether the Neptune cluster is the primary cluster (that is, has read-write capability) for the Neptune
* global database with which it is associated.
*
*/
private Boolean isWriter;
/**
*
* The Amazon Resource Name (ARN) for each Neptune cluster.
*
*
* @param dBClusterArn
* The Amazon Resource Name (ARN) for each Neptune cluster.
*/
public void setDBClusterArn(String dBClusterArn) {
this.dBClusterArn = dBClusterArn;
}
/**
*
* The Amazon Resource Name (ARN) for each Neptune cluster.
*
*
* @return The Amazon Resource Name (ARN) for each Neptune cluster.
*/
public String getDBClusterArn() {
return this.dBClusterArn;
}
/**
*
* The Amazon Resource Name (ARN) for each Neptune cluster.
*
*
* @param dBClusterArn
* The Amazon Resource Name (ARN) for each Neptune cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GlobalClusterMember withDBClusterArn(String dBClusterArn) {
setDBClusterArn(dBClusterArn);
return this;
}
/**
*
* The Amazon Resource Name (ARN) for each read-only secondary cluster associated with the Neptune global database.
*
*
* @return The Amazon Resource Name (ARN) for each read-only secondary cluster associated with the Neptune global
* database.
*/
public java.util.List getReaders() {
return readers;
}
/**
*
* The Amazon Resource Name (ARN) for each read-only secondary cluster associated with the Neptune global database.
*
*
* @param readers
* The Amazon Resource Name (ARN) for each read-only secondary cluster associated with the Neptune global
* database.
*/
public void setReaders(java.util.Collection readers) {
if (readers == null) {
this.readers = null;
return;
}
this.readers = new java.util.ArrayList(readers);
}
/**
*
* The Amazon Resource Name (ARN) for each read-only secondary cluster associated with the Neptune global database.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setReaders(java.util.Collection)} or {@link #withReaders(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param readers
* The Amazon Resource Name (ARN) for each read-only secondary cluster associated with the Neptune global
* database.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GlobalClusterMember withReaders(String... readers) {
if (this.readers == null) {
setReaders(new java.util.ArrayList(readers.length));
}
for (String ele : readers) {
this.readers.add(ele);
}
return this;
}
/**
*
* The Amazon Resource Name (ARN) for each read-only secondary cluster associated with the Neptune global database.
*
*
* @param readers
* The Amazon Resource Name (ARN) for each read-only secondary cluster associated with the Neptune global
* database.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GlobalClusterMember withReaders(java.util.Collection readers) {
setReaders(readers);
return this;
}
/**
*
* Specifies whether the Neptune cluster is the primary cluster (that is, has read-write capability) for the Neptune
* global database with which it is associated.
*
*
* @param isWriter
* Specifies whether the Neptune cluster is the primary cluster (that is, has read-write capability) for the
* Neptune global database with which it is associated.
*/
public void setIsWriter(Boolean isWriter) {
this.isWriter = isWriter;
}
/**
*
* Specifies whether the Neptune cluster is the primary cluster (that is, has read-write capability) for the Neptune
* global database with which it is associated.
*
*
* @return Specifies whether the Neptune cluster is the primary cluster (that is, has read-write capability) for the
* Neptune global database with which it is associated.
*/
public Boolean getIsWriter() {
return this.isWriter;
}
/**
*
* Specifies whether the Neptune cluster is the primary cluster (that is, has read-write capability) for the Neptune
* global database with which it is associated.
*
*
* @param isWriter
* Specifies whether the Neptune cluster is the primary cluster (that is, has read-write capability) for the
* Neptune global database with which it is associated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GlobalClusterMember withIsWriter(Boolean isWriter) {
setIsWriter(isWriter);
return this;
}
/**
*
* Specifies whether the Neptune cluster is the primary cluster (that is, has read-write capability) for the Neptune
* global database with which it is associated.
*
*
* @return Specifies whether the Neptune cluster is the primary cluster (that is, has read-write capability) for the
* Neptune global database with which it is associated.
*/
public Boolean isWriter() {
return this.isWriter;
}
/**
* 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 (getDBClusterArn() != null)
sb.append("DBClusterArn: ").append(getDBClusterArn()).append(",");
if (getReaders() != null)
sb.append("Readers: ").append(getReaders()).append(",");
if (getIsWriter() != null)
sb.append("IsWriter: ").append(getIsWriter());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GlobalClusterMember == false)
return false;
GlobalClusterMember other = (GlobalClusterMember) obj;
if (other.getDBClusterArn() == null ^ this.getDBClusterArn() == null)
return false;
if (other.getDBClusterArn() != null && other.getDBClusterArn().equals(this.getDBClusterArn()) == false)
return false;
if (other.getReaders() == null ^ this.getReaders() == null)
return false;
if (other.getReaders() != null && other.getReaders().equals(this.getReaders()) == false)
return false;
if (other.getIsWriter() == null ^ this.getIsWriter() == null)
return false;
if (other.getIsWriter() != null && other.getIsWriter().equals(this.getIsWriter()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDBClusterArn() == null) ? 0 : getDBClusterArn().hashCode());
hashCode = prime * hashCode + ((getReaders() == null) ? 0 : getReaders().hashCode());
hashCode = prime * hashCode + ((getIsWriter() == null) ? 0 : getIsWriter().hashCode());
return hashCode;
}
@Override
public GlobalClusterMember clone() {
try {
return (GlobalClusterMember) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}