Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2014 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.ec2.model;
 
 
 public class CreateVolumePermissionModifications implements Serializable {

    
Adds a specific AWS account ID or group to a volume's list of create volume permissions.
 
Removes a specific AWS account ID or group from a volume's list of create volume permissions.
 
Adds a specific AWS account ID or group to a volume's list of create volume permissions.

Returns:
Adds a specific AWS account ID or group to a volume's list of create volume permissions.
 
     public java.util.List<CreateVolumePermissiongetAdd() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<CreateVolumePermission>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
Adds a specific AWS account ID or group to a volume's list of create volume permissions.

Parameters:
add Adds a specific AWS account ID or group to a volume's list of create volume permissions.
 
     public void setAdd(java.util.Collection<CreateVolumePermissionadd) {
         if (add == null) {
             this. = null;
             return;
         }
         addCopy.addAll(add);
         this. = addCopy;
     }
    
    
Adds a specific AWS account ID or group to a volume's list of create volume permissions.

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

Parameters:
add Adds a specific AWS account ID or group to a volume's list of create volume permissions.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (getAdd() == nullsetAdd(new java.util.ArrayList<CreateVolumePermission>(add.length));
         for (CreateVolumePermission value : add) {
             getAdd().add(value);
         }
         return this;
     }
    
    
Adds a specific AWS account ID or group to a volume's list of create volume permissions.

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

Parameters:
add Adds a specific AWS account ID or group to a volume's list of create volume permissions.
Returns:
A reference to this updated object so that method calls can be chained together.
 
        if (add == null) {
            this. = null;
        } else {
            addCopy.addAll(add);
            this. = addCopy;
        }
        return this;
    }

    
Removes a specific AWS account ID or group from a volume's list of create volume permissions.

Returns:
Removes a specific AWS account ID or group from a volume's list of create volume permissions.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Removes a specific AWS account ID or group from a volume's list of create volume permissions.

Parameters:
remove Removes a specific AWS account ID or group from a volume's list of create volume permissions.
    public void setRemove(java.util.Collection<CreateVolumePermissionremove) {
        if (remove == null) {
            this. = null;
            return;
        }
        removeCopy.addAll(remove);
        this. = removeCopy;
    }
    
    
Removes a specific AWS account ID or group from a volume's list of create volume permissions.

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

Parameters:
remove Removes a specific AWS account ID or group from a volume's list of create volume permissions.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getRemove() == nullsetRemove(new java.util.ArrayList<CreateVolumePermission>(remove.length));
        for (CreateVolumePermission value : remove) {
            getRemove().add(value);
        }
        return this;
    }
    
    
Removes a specific AWS account ID or group from a volume's list of create volume permissions.

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

Parameters:
remove Removes a specific AWS account ID or group from a volume's list of create volume permissions.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (remove == null) {
            this. = null;
        } else {
            removeCopy.addAll(remove);
            this. = removeCopy;
        }
        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 (getAdd() != nullsb.append("Add: " + getAdd() + ",");
        if (getRemove() != nullsb.append("Remove: " + getRemove() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getAdd() == null) ? 0 : getAdd().hashCode()); 
        hashCode = prime * hashCode + ((getRemove() == null) ? 0 : getRemove().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateVolumePermissionModifications == falsereturn false;
        
        if (other.getAdd() == null ^ this.getAdd() == nullreturn false;
        if (other.getAdd() != null && other.getAdd().equals(this.getAdd()) == falsereturn false
        if (other.getRemove() == null ^ this.getRemove() == nullreturn false;
        if (other.getRemove() != null && other.getRemove().equals(this.getRemove()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X