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.ec2.model;
 
 
 public class DescribeSnapshotAttributeResult implements SerializableCloneable {

    
The ID of the EBS snapshot.
 
     private String snapshotId;

    
A list of permissions for creating volumes from the snapshot.
 
A list of product codes.
 
The ID of the EBS snapshot.

Returns:
The ID of the EBS snapshot.
 
     public String getSnapshotId() {
         return ;
     }
    
    
The ID of the EBS snapshot.

Parameters:
snapshotId The ID of the EBS snapshot.
 
     public void setSnapshotId(String snapshotId) {
         this. = snapshotId;
     }
    
    
The ID of the EBS snapshot.

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

Parameters:
snapshotId The ID of the EBS snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public DescribeSnapshotAttributeResult withSnapshotId(String snapshotId) {
         this. = snapshotId;
         return this;
     }

    
A list of permissions for creating volumes from the snapshot.

Returns:
A list of permissions for creating volumes from the snapshot.
 
         if ( == null) {
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
A list of permissions for creating volumes from the snapshot.

Parameters:
createVolumePermissions A list of permissions for creating volumes from the snapshot.
 
     public void setCreateVolumePermissions(java.util.Collection<CreateVolumePermissioncreateVolumePermissions) {
         if (createVolumePermissions == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<CreateVolumePermissioncreateVolumePermissionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<CreateVolumePermission>(createVolumePermissions.size());
         createVolumePermissionsCopy.addAll(createVolumePermissions);
         this. = createVolumePermissionsCopy;
     }
    
    
A list of permissions for creating volumes from the snapshot.

NOTE: This method appends the values to the existing list (if any). Use setCreateVolumePermissions(java.util.Collection) or withCreateVolumePermissions(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:
createVolumePermissions A list of permissions for creating volumes from the snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getCreateVolumePermissions() == nullsetCreateVolumePermissions(new java.util.ArrayList<CreateVolumePermission>(createVolumePermissions.length));
        for (CreateVolumePermission value : createVolumePermissions) {
            getCreateVolumePermissions().add(value);
        }
        return this;
    }
    
    
A list of permissions for creating volumes from the snapshot.

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

Parameters:
createVolumePermissions A list of permissions for creating volumes from the snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (createVolumePermissions == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<CreateVolumePermissioncreateVolumePermissionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<CreateVolumePermission>(createVolumePermissions.size());
            createVolumePermissionsCopy.addAll(createVolumePermissions);
            this. = createVolumePermissionsCopy;
        }
        return this;
    }

    
A list of product codes.

Returns:
A list of product codes.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of product codes.

Parameters:
productCodes A list of product codes.
    public void setProductCodes(java.util.Collection<ProductCodeproductCodes) {
        if (productCodes == null) {
            this. = null;
            return;
        }
        productCodesCopy.addAll(productCodes);
        this. = productCodesCopy;
    }
    
    
A list of product codes.

NOTE: This method appends the values to the existing list (if any). Use setProductCodes(java.util.Collection) or withProductCodes(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:
productCodes A list of product codes.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getProductCodes() == nullsetProductCodes(new java.util.ArrayList<ProductCode>(productCodes.length));
        for (ProductCode value : productCodes) {
            getProductCodes().add(value);
        }
        return this;
    }
    
    
A list of product codes.

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

Parameters:
productCodes A list of product codes.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (productCodes == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<ProductCodeproductCodesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<ProductCode>(productCodes.size());
            productCodesCopy.addAll(productCodes);
            this. = productCodesCopy;
        }
        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 (getSnapshotId() != nullsb.append("SnapshotId: " + getSnapshotId() + ",");
        if (getCreateVolumePermissions() != nullsb.append("CreateVolumePermissions: " + getCreateVolumePermissions() + ",");
        if (getProductCodes() != nullsb.append("ProductCodes: " + getProductCodes() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSnapshotId() == null) ? 0 : getSnapshotId().hashCode()); 
        hashCode = prime * hashCode + ((getCreateVolumePermissions() == null) ? 0 : getCreateVolumePermissions().hashCode()); 
        hashCode = prime * hashCode + ((getProductCodes() == null) ? 0 : getProductCodes().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DescribeSnapshotAttributeResult == falsereturn false;
        
        if (other.getSnapshotId() == null ^ this.getSnapshotId() == nullreturn false;
        if (other.getSnapshotId() != null && other.getSnapshotId().equals(this.getSnapshotId()) == falsereturn false
        if (other.getCreateVolumePermissions() == null ^ this.getCreateVolumePermissions() == nullreturn false;
        if (other.getCreateVolumePermissions() != null && other.getCreateVolumePermissions().equals(this.getCreateVolumePermissions()) == falsereturn false
        if (other.getProductCodes() == null ^ this.getProductCodes() == nullreturn false;
        if (other.getProductCodes() != null && other.getProductCodes().equals(this.getProductCodes()) == falsereturn false
        return true;
    }
    
    @Override
        try {
            return (DescribeSnapshotAttributeResultsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X