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;
 

The disk container object for the ImportSnapshot request.

 
 public class SnapshotDiskContainer implements SerializableCloneable {

    
The description of the disk image being imported.
 
     private String description;

    
The format of the disk image being imported.
 
     private String format;

    
The URL to the Amazon S3-based disk image being imported. It can either be a https URL (https://..) or an Amazon S3 URL (s3://..).
 
     private String url;

    
 
     private UserBucket userBucket;

    
The description of the disk image being imported.

Returns:
The description of the disk image being imported.
 
     public String getDescription() {
         return ;
     }
    
    
The description of the disk image being imported.

Parameters:
description The description of the disk image being imported.
 
     public void setDescription(String description) {
         this. = description;
     }
    
    
The description of the disk image being imported.

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

Parameters:
description The description of the disk image being imported.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public SnapshotDiskContainer withDescription(String description) {
         this. = description;
         return this;
     }

    
The format of the disk image being imported.

Returns:
The format of the disk image being imported.
 
     public String getFormat() {
         return ;
     }
    
    
The format of the disk image being imported.

Parameters:
format The format of the disk image being imported.
 
     public void setFormat(String format) {
         this. = format;
     }
    
    
The format of the disk image being imported.

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

Parameters:
format The format of the disk image being imported.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SnapshotDiskContainer withFormat(String format) {
        this. = format;
        return this;
    }

    
The URL to the Amazon S3-based disk image being imported. It can either be a https URL (https://..) or an Amazon S3 URL (s3://..).

Returns:
The URL to the Amazon S3-based disk image being imported. It can either be a https URL (https://..) or an Amazon S3 URL (s3://..).
    public String getUrl() {
        return ;
    }
    
    
The URL to the Amazon S3-based disk image being imported. It can either be a https URL (https://..) or an Amazon S3 URL (s3://..).

Parameters:
url The URL to the Amazon S3-based disk image being imported. It can either be a https URL (https://..) or an Amazon S3 URL (s3://..).
    public void setUrl(String url) {
        this. = url;
    }
    
    
The URL to the Amazon S3-based disk image being imported. It can either be a https URL (https://..) or an Amazon S3 URL (s3://..).

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

Parameters:
url The URL to the Amazon S3-based disk image being imported. It can either be a https URL (https://..) or an Amazon S3 URL (s3://..).
Returns:
A reference to this updated object so that method calls can be chained together.
    public SnapshotDiskContainer withUrl(String url) {
        this. = url;
        return this;
    }

    

Returns:
    public UserBucket getUserBucket() {
        return ;
    }
    
    

Parameters:
userBucket
    public void setUserBucket(UserBucket userBucket) {
        this. = userBucket;
    }
    
    

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

Parameters:
userBucket
Returns:
A reference to this updated object so that method calls can be chained together.
    public SnapshotDiskContainer withUserBucket(UserBucket userBucket) {
        this. = userBucket;
        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 (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getFormat() != nullsb.append("Format: " + getFormat() + ",");
        if (getUrl() != nullsb.append("Url: " + getUrl() + ",");
        if (getUserBucket() != nullsb.append("UserBucket: " + getUserBucket() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode()); 
        hashCode = prime * hashCode + ((getUrl() == null) ? 0 : getUrl().hashCode()); 
        hashCode = prime * hashCode + ((getUserBucket() == null) ? 0 : getUserBucket().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof SnapshotDiskContainer == falsereturn false;
        SnapshotDiskContainer other = (SnapshotDiskContainer)obj;
        
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getFormat() == null ^ this.getFormat() == nullreturn false;
        if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == falsereturn false
        if (other.getUrl() == null ^ this.getUrl() == nullreturn false;
        if (other.getUrl() != null && other.getUrl().equals(this.getUrl()) == falsereturn false
        if (other.getUserBucket() == null ^ this.getUserBucket() == nullreturn false;
        if (other.getUserBucket() != null && other.getUserBucket().equals(this.getUserBucket()) == falsereturn false
        return true;
    }
    
    @Override
    public SnapshotDiskContainer clone() {
        try {
            return (SnapshotDiskContainersuper.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