com.amazonaws.services.cloudhsm.model.ModifyHapgRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudhsm Show documentation
/*
* Copyright 2013-2018 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.cloudhsm.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ModifyHapgRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The ARN of the high-availability partition group to modify.
*
*/
private String hapgArn;
/**
*
* The new label for the high-availability partition group.
*
*/
private String label;
/**
*
* The list of partition serial numbers to make members of the high-availability partition group.
*
*/
private com.amazonaws.internal.SdkInternalList partitionSerialList;
/**
*
* The ARN of the high-availability partition group to modify.
*
*
* @param hapgArn
* The ARN of the high-availability partition group to modify.
*/
public void setHapgArn(String hapgArn) {
this.hapgArn = hapgArn;
}
/**
*
* The ARN of the high-availability partition group to modify.
*
*
* @return The ARN of the high-availability partition group to modify.
*/
public String getHapgArn() {
return this.hapgArn;
}
/**
*
* The ARN of the high-availability partition group to modify.
*
*
* @param hapgArn
* The ARN of the high-availability partition group to modify.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyHapgRequest withHapgArn(String hapgArn) {
setHapgArn(hapgArn);
return this;
}
/**
*
* The new label for the high-availability partition group.
*
*
* @param label
* The new label for the high-availability partition group.
*/
public void setLabel(String label) {
this.label = label;
}
/**
*
* The new label for the high-availability partition group.
*
*
* @return The new label for the high-availability partition group.
*/
public String getLabel() {
return this.label;
}
/**
*
* The new label for the high-availability partition group.
*
*
* @param label
* The new label for the high-availability partition group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyHapgRequest withLabel(String label) {
setLabel(label);
return this;
}
/**
*
* The list of partition serial numbers to make members of the high-availability partition group.
*
*
* @return The list of partition serial numbers to make members of the high-availability partition group.
*/
public java.util.List getPartitionSerialList() {
if (partitionSerialList == null) {
partitionSerialList = new com.amazonaws.internal.SdkInternalList();
}
return partitionSerialList;
}
/**
*
* The list of partition serial numbers to make members of the high-availability partition group.
*
*
* @param partitionSerialList
* The list of partition serial numbers to make members of the high-availability partition group.
*/
public void setPartitionSerialList(java.util.Collection partitionSerialList) {
if (partitionSerialList == null) {
this.partitionSerialList = null;
return;
}
this.partitionSerialList = new com.amazonaws.internal.SdkInternalList(partitionSerialList);
}
/**
*
* The list of partition serial numbers to make members of the high-availability partition group.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPartitionSerialList(java.util.Collection)} or {@link #withPartitionSerialList(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param partitionSerialList
* The list of partition serial numbers to make members of the high-availability partition group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyHapgRequest withPartitionSerialList(String... partitionSerialList) {
if (this.partitionSerialList == null) {
setPartitionSerialList(new com.amazonaws.internal.SdkInternalList(partitionSerialList.length));
}
for (String ele : partitionSerialList) {
this.partitionSerialList.add(ele);
}
return this;
}
/**
*
* The list of partition serial numbers to make members of the high-availability partition group.
*
*
* @param partitionSerialList
* The list of partition serial numbers to make members of the high-availability partition group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ModifyHapgRequest withPartitionSerialList(java.util.Collection partitionSerialList) {
setPartitionSerialList(partitionSerialList);
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 (getHapgArn() != null)
sb.append("HapgArn: ").append(getHapgArn()).append(",");
if (getLabel() != null)
sb.append("Label: ").append(getLabel()).append(",");
if (getPartitionSerialList() != null)
sb.append("PartitionSerialList: ").append(getPartitionSerialList());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ModifyHapgRequest == false)
return false;
ModifyHapgRequest other = (ModifyHapgRequest) obj;
if (other.getHapgArn() == null ^ this.getHapgArn() == null)
return false;
if (other.getHapgArn() != null && other.getHapgArn().equals(this.getHapgArn()) == false)
return false;
if (other.getLabel() == null ^ this.getLabel() == null)
return false;
if (other.getLabel() != null && other.getLabel().equals(this.getLabel()) == false)
return false;
if (other.getPartitionSerialList() == null ^ this.getPartitionSerialList() == null)
return false;
if (other.getPartitionSerialList() != null && other.getPartitionSerialList().equals(this.getPartitionSerialList()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getHapgArn() == null) ? 0 : getHapgArn().hashCode());
hashCode = prime * hashCode + ((getLabel() == null) ? 0 : getLabel().hashCode());
hashCode = prime * hashCode + ((getPartitionSerialList() == null) ? 0 : getPartitionSerialList().hashCode());
return hashCode;
}
@Override
public ModifyHapgRequest clone() {
return (ModifyHapgRequest) super.clone();
}
}