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;
 

Describes a disk image.

 
 public class DiskImage implements SerializableCloneable {

    
Information about the disk image.
 
     private DiskImageDetail image;

    
A description of the disk image.
 
     private String description;

    
Information about the volume.
 
     private VolumeDetail volume;

    
Information about the disk image.

Returns:
Information about the disk image.
 
     public DiskImageDetail getImage() {
         return ;
     }
    
    
Information about the disk image.

Parameters:
image Information about the disk image.
 
     public void setImage(DiskImageDetail image) {
         this. = image;
     }
    
    
Information about the disk image.

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

Parameters:
image Information about the disk image.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public DiskImage withImage(DiskImageDetail image) {
         this. = image;
         return this;
     }

    
A description of the disk image.

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

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

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

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

    
Information about the volume.

Returns:
Information about the volume.
    public VolumeDetail getVolume() {
        return ;
    }
    
    
Information about the volume.

Parameters:
volume Information about the volume.
    public void setVolume(VolumeDetail volume) {
        this. = volume;
    }
    
    
Information about the volume.

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

Parameters:
volume Information about the volume.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DiskImage withVolume(VolumeDetail volume) {
        this. = volume;
        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 (getImage() != nullsb.append("Image: " + getImage() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getVolume() != nullsb.append("Volume: " + getVolume() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getImage() == null) ? 0 : getImage().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getVolume() == null) ? 0 : getVolume().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DiskImage == falsereturn false;
        DiskImage other = (DiskImage)obj;
        
        if (other.getImage() == null ^ this.getImage() == nullreturn false;
        if (other.getImage() != null && other.getImage().equals(this.getImage()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getVolume() == null ^ this.getVolume() == nullreturn false;
        if (other.getVolume() != null && other.getVolume().equals(this.getVolume()) == falsereturn false
        return true;
    }
    
    @Override
    public DiskImage clone() {
        try {
            return (DiskImagesuper.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