Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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;
 
 
Container for the parameters to the ModifyHapg operation.

Modifies an existing high-availability partition group.

 
 public class ModifyHapgRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The ARN of the high-availability partition group to modify.

Constraints:
Pattern: arn:aws(-iso)?:cloudhsm:[a-zA-Z0-9\-]*:[0-9]{12}:hapg-[0-9a-f]{8}

 
     private String hapgArn;

    
The new label for the high-availability partition group.

Constraints:
Pattern: [a-zA-Z0-9_.-]{1,64}

 
     private String label;

    
The list of partition serial numbers to make members of the high-availability partition group.
 
The ARN of the high-availability partition group to modify.

Constraints:
Pattern: arn:aws(-iso)?:cloudhsm:[a-zA-Z0-9\-]*:[0-9]{12}:hapg-[0-9a-f]{8}

Returns:
The ARN of the high-availability partition group to modify.
 
     public String getHapgArn() {
         return ;
     }
    
    
The ARN of the high-availability partition group to modify.

Constraints:
Pattern: arn:aws(-iso)?:cloudhsm:[a-zA-Z0-9\-]*:[0-9]{12}:hapg-[0-9a-f]{8}

Parameters:
hapgArn The ARN of the high-availability partition group to modify.
 
     public void setHapgArn(String hapgArn) {
         this. = hapgArn;
     }
    
    
The ARN of the high-availability partition group to modify.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: arn:aws(-iso)?:cloudhsm:[a-zA-Z0-9\-]*:[0-9]{12}:hapg-[0-9a-f]{8}

Parameters:
hapgArn The ARN of the high-availability partition group to modify.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ModifyHapgRequest withHapgArn(String hapgArn) {
         this. = hapgArn;
         return this;
     }

    
The new label for the high-availability partition group.

Constraints:
Pattern: [a-zA-Z0-9_.-]{1,64}

Returns:
The new label for the high-availability partition group.
    public String getLabel() {
        return ;
    }
    
    
The new label for the high-availability partition group.

Constraints:
Pattern: [a-zA-Z0-9_.-]{1,64}

Parameters:
label The new label for the high-availability partition group.
    public void setLabel(String label) {
        this. = label;
    }
    
    
The new label for the high-availability partition group.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: [a-zA-Z0-9_.-]{1,64}

Parameters:
label The new label for the high-availability partition group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifyHapgRequest withLabel(String label) {
        this. = label;
        return this;
    }

    
The list of partition serial numbers to make members of the high-availability partition group.

Returns:
The list of partition serial numbers to make members of the high-availability partition group.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The list of partition serial numbers to make members of the high-availability partition group.

Parameters:
partitionSerialList The list of partition serial numbers to make members of the high-availability partition group.
    public void setPartitionSerialList(java.util.Collection<StringpartitionSerialList) {
        if (partitionSerialList == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringpartitionSerialListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(partitionSerialList.size());
        partitionSerialListCopy.addAll(partitionSerialList);
        this. = partitionSerialListCopy;
    }
    
    
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 setPartitionSerialList(java.util.Collection) or withPartitionSerialList(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
partitionSerialList The list of partition serial numbers to make members of the high-availability partition group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifyHapgRequest withPartitionSerialList(String... partitionSerialList) {
        if (getPartitionSerialList() == nullsetPartitionSerialList(new java.util.ArrayList<String>(partitionSerialList.length));
        for (String value : partitionSerialList) {
            getPartitionSerialList().add(value);
        }
        return this;
    }
    
    
The list of partition serial numbers to make members of the high-availability partition group.

Returns a reference to this object so that method calls can be chained together.

Parameters:
partitionSerialList The list of partition serial numbers to make members of the high-availability partition group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifyHapgRequest withPartitionSerialList(java.util.Collection<StringpartitionSerialList) {
        if (partitionSerialList == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringpartitionSerialListCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(partitionSerialList.size());
            partitionSerialListCopy.addAll(partitionSerialList);
            this. = partitionSerialListCopy;
        }
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getHapgArn() != nullsb.append("HapgArn: " + getHapgArn() + ",");
        if (getLabel() != nullsb.append("Label: " + getLabel() + ",");
        if (getPartitionSerialList() != nullsb.append("PartitionSerialList: " + getPartitionSerialList() );
        sb.append("}");
        return sb.toString();
    }
    
    @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 boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ModifyHapgRequest == falsereturn false;
        ModifyHapgRequest other = (ModifyHapgRequest)obj;
        
        if (other.getHapgArn() == null ^ this.getHapgArn() == nullreturn false;
        if (other.getHapgArn() != null && other.getHapgArn().equals(this.getHapgArn()) == falsereturn false
        if (other.getLabel() == null ^ this.getLabel() == nullreturn false;
        if (other.getLabel() != null && other.getLabel().equals(this.getLabel()) == falsereturn false
        if (other.getPartitionSerialList() == null ^ this.getPartitionSerialList() == nullreturn false;
        if (other.getPartitionSerialList() != null && other.getPartitionSerialList().equals(this.getPartitionSerialList()) == falsereturn false
        return true;
    }
    
    @Override
    public ModifyHapgRequest clone() {
        
            return (ModifyHapgRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X