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 an image.

  
  public class Image implements SerializableCloneable {

    
The ID of the AMI.
  
      private String imageId;

    
The location of the AMI.
  
      private String imageLocation;

    
The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.

Constraints:
Allowed Values: pending, available, invalid, deregistered, transient, failed, error

  
      private String state;

    
The AWS account ID of the image owner.
  
      private String ownerId;

    
The date and time the image was created.
  
      private String creationDate;

    
Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.
  
      private Boolean publicValue;

    
Any product codes associated with the AMI.
  
The architecture of the image.

Constraints:
Allowed Values: i386, x86_64

  
      private String architecture;

    
The type of image.

Constraints:
Allowed Values: machine, kernel, ramdisk

  
      private String imageType;

    
The kernel associated with the image, if any. Only applicable for machine images.
  
      private String kernelId;

    
The RAM disk associated with the image, if any. Only applicable for machine images.
  
      private String ramdiskId;

    
The value is Windows for Windows AMIs; otherwise blank.

Constraints:
Allowed Values: Windows

 
     private String platform;

    
Specifies whether enhanced networking is enabled.
 
     private String sriovNetSupport;

    
The reason for the state change.
 
     private StateReason stateReason;

    
The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
 
     private String imageOwnerAlias;

    
The name of the AMI that was provided during image creation.
 
     private String name;

    
The description of the AMI that was provided during image creation.
 
     private String description;

    
The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.

Constraints:
Allowed Values: ebs, instance-store

 
     private String rootDeviceType;

    
The device name of the root device (for example, /dev/sda1 or /dev/xvda).
 
     private String rootDeviceName;

    
Any block device mapping entries.
 
The type of virtualization of the AMI.

Constraints:
Allowed Values: hvm, paravirtual

 
     private String virtualizationType;

    
Any tags assigned to the image.
 
The hypervisor type of the image.

Constraints:
Allowed Values: ovm, xen

 
     private String hypervisor;

    
The ID of the AMI.

Returns:
The ID of the AMI.
 
     public String getImageId() {
         return ;
     }
    
    
The ID of the AMI.

Parameters:
imageId The ID of the AMI.
 
     public void setImageId(String imageId) {
         this. = imageId;
     }
    
    
The ID of the AMI.

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

Parameters:
imageId The ID of the AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withImageId(String imageId) {
         this. = imageId;
         return this;
     }

    
The location of the AMI.

Returns:
The location of the AMI.
 
     public String getImageLocation() {
         return ;
     }
    
    
The location of the AMI.

Parameters:
imageLocation The location of the AMI.
 
     public void setImageLocation(String imageLocation) {
         this. = imageLocation;
     }
    
    
The location of the AMI.

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

Parameters:
imageLocation The location of the AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withImageLocation(String imageLocation) {
         this. = imageLocation;
         return this;
     }

    
The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.

Constraints:
Allowed Values: pending, available, invalid, deregistered, transient, failed, error

Returns:
The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.
See also:
ImageState
 
     public String getState() {
         return ;
     }
    
    
The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.

Constraints:
Allowed Values: pending, available, invalid, deregistered, transient, failed, error

Parameters:
state The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.
See also:
ImageState
 
     public void setState(String state) {
         this. = state;
     }
    
    
The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.

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

Constraints:
Allowed Values: pending, available, invalid, deregistered, transient, failed, error

Parameters:
state The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ImageState
 
     public Image withState(String state) {
         this. = state;
         return this;
     }

    
The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.

Constraints:
Allowed Values: pending, available, invalid, deregistered, transient, failed, error

Parameters:
state The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.
See also:
ImageState
 
     public void setState(ImageState state) {
         this. = state.toString();
     }
    
    
The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.

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

Constraints:
Allowed Values: pending, available, invalid, deregistered, transient, failed, error

Parameters:
state The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ImageState
 
     public Image withState(ImageState state) {
         this. = state.toString();
         return this;
     }

    
The AWS account ID of the image owner.

Returns:
The AWS account ID of the image owner.
 
     public String getOwnerId() {
         return ;
     }
    
    
The AWS account ID of the image owner.

Parameters:
ownerId The AWS account ID of the image owner.
 
     public void setOwnerId(String ownerId) {
         this. = ownerId;
     }
    
    
The AWS account ID of the image owner.

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

Parameters:
ownerId The AWS account ID of the image owner.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withOwnerId(String ownerId) {
         this. = ownerId;
         return this;
     }

    
The date and time the image was created.

Returns:
The date and time the image was created.
 
     public String getCreationDate() {
         return ;
     }
    
    
The date and time the image was created.

Parameters:
creationDate The date and time the image was created.
 
     public void setCreationDate(String creationDate) {
         this. = creationDate;
     }
    
    
The date and time the image was created.

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

Parameters:
creationDate The date and time the image was created.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withCreationDate(String creationDate) {
         this. = creationDate;
         return this;
     }

    
Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.

Returns:
Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.
 
     public Boolean isPublic() {
         return ;
     }
    
    
Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.

Parameters:
publicValue Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.
 
     public void setPublic(Boolean publicValue) {
         this. = publicValue;
     }
    
    
Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.

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

Parameters:
publicValue Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withPublic(Boolean publicValue) {
         this. = publicValue;
         return this;
     }

    
Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.

Returns:
Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.
 
     public Boolean getPublic() {
         return ;
     }

    
Any product codes associated with the AMI.

Returns:
Any product codes associated with the AMI.
 
     public java.util.List<ProductCodegetProductCodes() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<ProductCode>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
Any product codes associated with the AMI.

Parameters:
productCodes Any product codes associated with the AMI.
 
     public void setProductCodes(java.util.Collection<ProductCodeproductCodes) {
         if (productCodes == null) {
             this. = null;
             return;
         }
         productCodesCopy.addAll(productCodes);
         this. = productCodesCopy;
     }
    
    
Any product codes associated with the AMI.

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 Any product codes associated with the AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withProductCodes(ProductCode... productCodes) {
         if (getProductCodes() == nullsetProductCodes(new java.util.ArrayList<ProductCode>(productCodes.length));
         for (ProductCode value : productCodes) {
             getProductCodes().add(value);
         }
         return this;
     }
    
    
Any product codes associated with the AMI.

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

Parameters:
productCodes Any product codes associated with the AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withProductCodes(java.util.Collection<ProductCodeproductCodes) {
         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;
     }

    
The architecture of the image.

Constraints:
Allowed Values: i386, x86_64

Returns:
The architecture of the image.
See also:
ArchitectureValues
 
     public String getArchitecture() {
         return ;
     }
    
    
The architecture of the image.

Constraints:
Allowed Values: i386, x86_64

Parameters:
architecture The architecture of the image.
See also:
ArchitectureValues
 
     public void setArchitecture(String architecture) {
         this. = architecture;
     }
    
    
The architecture of the image.

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

Constraints:
Allowed Values: i386, x86_64

Parameters:
architecture The architecture of the image.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ArchitectureValues
 
     public Image withArchitecture(String architecture) {
         this. = architecture;
         return this;
     }

    
The architecture of the image.

Constraints:
Allowed Values: i386, x86_64

Parameters:
architecture The architecture of the image.
See also:
ArchitectureValues
 
     public void setArchitecture(ArchitectureValues architecture) {
         this. = architecture.toString();
     }
    
    
The architecture of the image.

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

Constraints:
Allowed Values: i386, x86_64

Parameters:
architecture The architecture of the image.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ArchitectureValues
 
     public Image withArchitecture(ArchitectureValues architecture) {
         this. = architecture.toString();
         return this;
     }

    
The type of image.

Constraints:
Allowed Values: machine, kernel, ramdisk

Returns:
The type of image.
See also:
ImageTypeValues
 
     public String getImageType() {
         return ;
     }
    
    
The type of image.

Constraints:
Allowed Values: machine, kernel, ramdisk

Parameters:
imageType The type of image.
See also:
ImageTypeValues
 
     public void setImageType(String imageType) {
         this. = imageType;
     }
    
    
The type of image.

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

Constraints:
Allowed Values: machine, kernel, ramdisk

Parameters:
imageType The type of image.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ImageTypeValues
 
     public Image withImageType(String imageType) {
         this. = imageType;
         return this;
     }

    
The type of image.

Constraints:
Allowed Values: machine, kernel, ramdisk

Parameters:
imageType The type of image.
See also:
ImageTypeValues
 
     public void setImageType(ImageTypeValues imageType) {
         this. = imageType.toString();
     }
    
    
The type of image.

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

Constraints:
Allowed Values: machine, kernel, ramdisk

Parameters:
imageType The type of image.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ImageTypeValues
 
     public Image withImageType(ImageTypeValues imageType) {
         this. = imageType.toString();
         return this;
     }

    
The kernel associated with the image, if any. Only applicable for machine images.

Returns:
The kernel associated with the image, if any. Only applicable for machine images.
 
     public String getKernelId() {
         return ;
     }
    
    
The kernel associated with the image, if any. Only applicable for machine images.

Parameters:
kernelId The kernel associated with the image, if any. Only applicable for machine images.
 
     public void setKernelId(String kernelId) {
         this. = kernelId;
     }
    
    
The kernel associated with the image, if any. Only applicable for machine images.

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

Parameters:
kernelId The kernel associated with the image, if any. Only applicable for machine images.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withKernelId(String kernelId) {
         this. = kernelId;
         return this;
     }

    
The RAM disk associated with the image, if any. Only applicable for machine images.

Returns:
The RAM disk associated with the image, if any. Only applicable for machine images.
 
     public String getRamdiskId() {
         return ;
     }
    
    
The RAM disk associated with the image, if any. Only applicable for machine images.

Parameters:
ramdiskId The RAM disk associated with the image, if any. Only applicable for machine images.
 
     public void setRamdiskId(String ramdiskId) {
         this. = ramdiskId;
     }
    
    
The RAM disk associated with the image, if any. Only applicable for machine images.

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

Parameters:
ramdiskId The RAM disk associated with the image, if any. Only applicable for machine images.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withRamdiskId(String ramdiskId) {
         this. = ramdiskId;
         return this;
     }

    
The value is Windows for Windows AMIs; otherwise blank.

Constraints:
Allowed Values: Windows

Returns:
The value is Windows for Windows AMIs; otherwise blank.
See also:
PlatformValues
 
     public String getPlatform() {
         return ;
     }
    
    
The value is Windows for Windows AMIs; otherwise blank.

Constraints:
Allowed Values: Windows

Parameters:
platform The value is Windows for Windows AMIs; otherwise blank.
See also:
PlatformValues
 
     public void setPlatform(String platform) {
         this. = platform;
     }
    
    
The value is Windows for Windows AMIs; otherwise blank.

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

Constraints:
Allowed Values: Windows

Parameters:
platform The value is Windows for Windows AMIs; otherwise blank.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
PlatformValues
 
     public Image withPlatform(String platform) {
         this. = platform;
         return this;
     }

    
The value is Windows for Windows AMIs; otherwise blank.

Constraints:
Allowed Values: Windows

Parameters:
platform The value is Windows for Windows AMIs; otherwise blank.
See also:
PlatformValues
 
     public void setPlatform(PlatformValues platform) {
         this. = platform.toString();
     }
    
    
The value is Windows for Windows AMIs; otherwise blank.

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

Constraints:
Allowed Values: Windows

Parameters:
platform The value is Windows for Windows AMIs; otherwise blank.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
PlatformValues
 
     public Image withPlatform(PlatformValues platform) {
         this. = platform.toString();
         return this;
     }

    
Specifies whether enhanced networking is enabled.

Returns:
Specifies whether enhanced networking is enabled.
 
     public String getSriovNetSupport() {
         return ;
     }
    
    
Specifies whether enhanced networking is enabled.

Parameters:
sriovNetSupport Specifies whether enhanced networking is enabled.
 
     public void setSriovNetSupport(String sriovNetSupport) {
         this. = sriovNetSupport;
     }
    
    
Specifies whether enhanced networking is enabled.

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

Parameters:
sriovNetSupport Specifies whether enhanced networking is enabled.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withSriovNetSupport(String sriovNetSupport) {
         this. = sriovNetSupport;
         return this;
     }

    
The reason for the state change.

Returns:
The reason for the state change.
 
     public StateReason getStateReason() {
         return ;
     }
    
    
The reason for the state change.

Parameters:
stateReason The reason for the state change.
 
     public void setStateReason(StateReason stateReason) {
         this. = stateReason;
     }
    
    
The reason for the state change.

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

Parameters:
stateReason The reason for the state change.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withStateReason(StateReason stateReason) {
         this. = stateReason;
         return this;
     }

    
The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.

Returns:
The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
 
     public String getImageOwnerAlias() {
         return ;
     }
    
    
The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.

Parameters:
imageOwnerAlias The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
 
     public void setImageOwnerAlias(String imageOwnerAlias) {
         this. = imageOwnerAlias;
     }
    
    
The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.

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

Parameters:
imageOwnerAlias The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Image withImageOwnerAlias(String imageOwnerAlias) {
         this. = imageOwnerAlias;
         return this;
     }

    
The name of the AMI that was provided during image creation.

Returns:
The name of the AMI that was provided during image creation.
 
     public String getName() {
         return ;
     }
    
    
The name of the AMI that was provided during image creation.

Parameters:
name The name of the AMI that was provided during image creation.
 
     public void setName(String name) {
         this. = name;
     }
    
    
The name of the AMI that was provided during image creation.

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

Parameters:
name The name of the AMI that was provided during image creation.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Image withName(String name) {
        this. = name;
        return this;
    }

    
The description of the AMI that was provided during image creation.

Returns:
The description of the AMI that was provided during image creation.
    public String getDescription() {
        return ;
    }
    
    
The description of the AMI that was provided during image creation.

Parameters:
description The description of the AMI that was provided during image creation.
    public void setDescription(String description) {
        this. = description;
    }
    
    
The description of the AMI that was provided during image creation.

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

Parameters:
description The description of the AMI that was provided during image creation.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Image withDescription(String description) {
        this. = description;
        return this;
    }

    
The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.

Constraints:
Allowed Values: ebs, instance-store

Returns:
The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.
See also:
DeviceType
    public String getRootDeviceType() {
        return ;
    }
    
    
The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.

Constraints:
Allowed Values: ebs, instance-store

Parameters:
rootDeviceType The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.
See also:
DeviceType
    public void setRootDeviceType(String rootDeviceType) {
        this. = rootDeviceType;
    }
    
    
The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.

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

Constraints:
Allowed Values: ebs, instance-store

Parameters:
rootDeviceType The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
DeviceType
    public Image withRootDeviceType(String rootDeviceType) {
        this. = rootDeviceType;
        return this;
    }

    
The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.

Constraints:
Allowed Values: ebs, instance-store

Parameters:
rootDeviceType The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.
See also:
DeviceType
    public void setRootDeviceType(DeviceType rootDeviceType) {
        this. = rootDeviceType.toString();
    }
    
    
The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.

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

Constraints:
Allowed Values: ebs, instance-store

Parameters:
rootDeviceType The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
DeviceType
    public Image withRootDeviceType(DeviceType rootDeviceType) {
        this. = rootDeviceType.toString();
        return this;
    }

    
The device name of the root device (for example, /dev/sda1 or /dev/xvda).

Returns:
The device name of the root device (for example, /dev/sda1 or /dev/xvda).
    public String getRootDeviceName() {
        return ;
    }
    
    
The device name of the root device (for example, /dev/sda1 or /dev/xvda).

Parameters:
rootDeviceName The device name of the root device (for example, /dev/sda1 or /dev/xvda).
    public void setRootDeviceName(String rootDeviceName) {
        this. = rootDeviceName;
    }
    
    
The device name of the root device (for example, /dev/sda1 or /dev/xvda).

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

Parameters:
rootDeviceName The device name of the root device (for example, /dev/sda1 or /dev/xvda).
Returns:
A reference to this updated object so that method calls can be chained together.
    public Image withRootDeviceName(String rootDeviceName) {
        this. = rootDeviceName;
        return this;
    }

    
Any block device mapping entries.

Returns:
Any block device mapping entries.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Any block device mapping entries.

Parameters:
blockDeviceMappings Any block device mapping entries.
    public void setBlockDeviceMappings(java.util.Collection<BlockDeviceMappingblockDeviceMappings) {
        if (blockDeviceMappings == null) {
            this. = null;
            return;
        }
        blockDeviceMappingsCopy.addAll(blockDeviceMappings);
        this. = blockDeviceMappingsCopy;
    }
    
    
Any block device mapping entries.

NOTE: This method appends the values to the existing list (if any). Use setBlockDeviceMappings(java.util.Collection) or withBlockDeviceMappings(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:
blockDeviceMappings Any block device mapping entries.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Image withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings) {
        if (getBlockDeviceMappings() == nullsetBlockDeviceMappings(new java.util.ArrayList<BlockDeviceMapping>(blockDeviceMappings.length));
        for (BlockDeviceMapping value : blockDeviceMappings) {
            getBlockDeviceMappings().add(value);
        }
        return this;
    }
    
    
Any block device mapping entries.

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

Parameters:
blockDeviceMappings Any block device mapping entries.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Image withBlockDeviceMappings(java.util.Collection<BlockDeviceMappingblockDeviceMappings) {
        if (blockDeviceMappings == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<BlockDeviceMappingblockDeviceMappingsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<BlockDeviceMapping>(blockDeviceMappings.size());
            blockDeviceMappingsCopy.addAll(blockDeviceMappings);
            this. = blockDeviceMappingsCopy;
        }
        return this;
    }

    
The type of virtualization of the AMI.

Constraints:
Allowed Values: hvm, paravirtual

Returns:
The type of virtualization of the AMI.
See also:
VirtualizationType
    public String getVirtualizationType() {
        return ;
    }
    
    
The type of virtualization of the AMI.

Constraints:
Allowed Values: hvm, paravirtual

Parameters:
virtualizationType The type of virtualization of the AMI.
See also:
VirtualizationType
    public void setVirtualizationType(String virtualizationType) {
        this. = virtualizationType;
    }
    
    
The type of virtualization of the AMI.

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

Constraints:
Allowed Values: hvm, paravirtual

Parameters:
virtualizationType The type of virtualization of the AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
VirtualizationType
    public Image withVirtualizationType(String virtualizationType) {
        this. = virtualizationType;
        return this;
    }

    
The type of virtualization of the AMI.

Constraints:
Allowed Values: hvm, paravirtual

Parameters:
virtualizationType The type of virtualization of the AMI.
See also:
VirtualizationType
    public void setVirtualizationType(VirtualizationType virtualizationType) {
        this. = virtualizationType.toString();
    }
    
    
The type of virtualization of the AMI.

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

Constraints:
Allowed Values: hvm, paravirtual

Parameters:
virtualizationType The type of virtualization of the AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
VirtualizationType
    public Image withVirtualizationType(VirtualizationType virtualizationType) {
        this. = virtualizationType.toString();
        return this;
    }

    
Any tags assigned to the image.

Returns:
Any tags assigned to the image.
    public java.util.List<TaggetTags() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Tag>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Any tags assigned to the image.

Parameters:
tags Any tags assigned to the image.
    public void setTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
            return;
        }
        tagsCopy.addAll(tags);
        this. = tagsCopy;
    }
    
    
Any tags assigned to the image.

NOTE: This method appends the values to the existing list (if any). Use setTags(java.util.Collection) or withTags(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:
tags Any tags assigned to the image.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Image withTags(Tag... tags) {
        if (getTags() == nullsetTags(new java.util.ArrayList<Tag>(tags.length));
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
Any tags assigned to the image.

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

Parameters:
tags Any tags assigned to the image.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Image withTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
        } else {
            tagsCopy.addAll(tags);
            this. = tagsCopy;
        }
        return this;
    }

    
The hypervisor type of the image.

Constraints:
Allowed Values: ovm, xen

Returns:
The hypervisor type of the image.
See also:
HypervisorType
    public String getHypervisor() {
        return ;
    }
    
    
The hypervisor type of the image.

Constraints:
Allowed Values: ovm, xen

Parameters:
hypervisor The hypervisor type of the image.
See also:
HypervisorType
    public void setHypervisor(String hypervisor) {
        this. = hypervisor;
    }
    
    
The hypervisor type of the image.

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

Constraints:
Allowed Values: ovm, xen

Parameters:
hypervisor The hypervisor type of the image.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
HypervisorType
    public Image withHypervisor(String hypervisor) {
        this. = hypervisor;
        return this;
    }

    
The hypervisor type of the image.

Constraints:
Allowed Values: ovm, xen

Parameters:
hypervisor The hypervisor type of the image.
See also:
HypervisorType
    public void setHypervisor(HypervisorType hypervisor) {
        this. = hypervisor.toString();
    }
    
    
The hypervisor type of the image.

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

Constraints:
Allowed Values: ovm, xen

Parameters:
hypervisor The hypervisor type of the image.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
HypervisorType
    public Image withHypervisor(HypervisorType hypervisor) {
        this. = hypervisor.toString();
        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 (getImageId() != nullsb.append("ImageId: " + getImageId() + ",");
        if (getImageLocation() != nullsb.append("ImageLocation: " + getImageLocation() + ",");
        if (getState() != nullsb.append("State: " + getState() + ",");
        if (getOwnerId() != nullsb.append("OwnerId: " + getOwnerId() + ",");
        if (getCreationDate() != nullsb.append("CreationDate: " + getCreationDate() + ",");
        if (isPublic() != nullsb.append("Public: " + isPublic() + ",");
        if (getProductCodes() != nullsb.append("ProductCodes: " + getProductCodes() + ",");
        if (getArchitecture() != nullsb.append("Architecture: " + getArchitecture() + ",");
        if (getImageType() != nullsb.append("ImageType: " + getImageType() + ",");
        if (getKernelId() != nullsb.append("KernelId: " + getKernelId() + ",");
        if (getRamdiskId() != nullsb.append("RamdiskId: " + getRamdiskId() + ",");
        if (getPlatform() != nullsb.append("Platform: " + getPlatform() + ",");
        if (getSriovNetSupport() != nullsb.append("SriovNetSupport: " + getSriovNetSupport() + ",");
        if (getStateReason() != nullsb.append("StateReason: " + getStateReason() + ",");
        if (getImageOwnerAlias() != nullsb.append("ImageOwnerAlias: " + getImageOwnerAlias() + ",");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getRootDeviceType() != nullsb.append("RootDeviceType: " + getRootDeviceType() + ",");
        if (getRootDeviceName() != nullsb.append("RootDeviceName: " + getRootDeviceName() + ",");
        if (getBlockDeviceMappings() != nullsb.append("BlockDeviceMappings: " + getBlockDeviceMappings() + ",");
        if (getVirtualizationType() != nullsb.append("VirtualizationType: " + getVirtualizationType() + ",");
        if (getTags() != nullsb.append("Tags: " + getTags() + ",");
        if (getHypervisor() != nullsb.append("Hypervisor: " + getHypervisor() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); 
        hashCode = prime * hashCode + ((getImageLocation() == null) ? 0 : getImageLocation().hashCode()); 
        hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
        hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode()); 
        hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); 
        hashCode = prime * hashCode + ((isPublic() == null) ? 0 : isPublic().hashCode()); 
        hashCode = prime * hashCode + ((getProductCodes() == null) ? 0 : getProductCodes().hashCode()); 
        hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode()); 
        hashCode = prime * hashCode + ((getImageType() == null) ? 0 : getImageType().hashCode()); 
        hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode()); 
        hashCode = prime * hashCode + ((getRamdiskId() == null) ? 0 : getRamdiskId().hashCode()); 
        hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); 
        hashCode = prime * hashCode + ((getSriovNetSupport() == null) ? 0 : getSriovNetSupport().hashCode()); 
        hashCode = prime * hashCode + ((getStateReason() == null) ? 0 : getStateReason().hashCode()); 
        hashCode = prime * hashCode + ((getImageOwnerAlias() == null) ? 0 : getImageOwnerAlias().hashCode()); 
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getRootDeviceType() == null) ? 0 : getRootDeviceType().hashCode()); 
        hashCode = prime * hashCode + ((getRootDeviceName() == null) ? 0 : getRootDeviceName().hashCode()); 
        hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); 
        hashCode = prime * hashCode + ((getVirtualizationType() == null) ? 0 : getVirtualizationType().hashCode()); 
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); 
        hashCode = prime * hashCode + ((getHypervisor() == null) ? 0 : getHypervisor().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Image == falsereturn false;
        Image other = (Image)obj;
        
        if (other.getImageId() == null ^ this.getImageId() == nullreturn false;
        if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == falsereturn false
        if (other.getImageLocation() == null ^ this.getImageLocation() == nullreturn false;
        if (other.getImageLocation() != null && other.getImageLocation().equals(this.getImageLocation()) == falsereturn false
        if (other.getState() == null ^ this.getState() == nullreturn false;
        if (other.getState() != null && other.getState().equals(this.getState()) == falsereturn false
        if (other.getOwnerId() == null ^ this.getOwnerId() == nullreturn false;
        if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == falsereturn false
        if (other.getCreationDate() == null ^ this.getCreationDate() == nullreturn false;
        if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == falsereturn false
        if (other.isPublic() == null ^ this.isPublic() == nullreturn false;
        if (other.isPublic() != null && other.isPublic().equals(this.isPublic()) == falsereturn false
        if (other.getProductCodes() == null ^ this.getProductCodes() == nullreturn false;
        if (other.getProductCodes() != null && other.getProductCodes().equals(this.getProductCodes()) == falsereturn false
        if (other.getArchitecture() == null ^ this.getArchitecture() == nullreturn false;
        if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == falsereturn false
        if (other.getImageType() == null ^ this.getImageType() == nullreturn false;
        if (other.getImageType() != null && other.getImageType().equals(this.getImageType()) == falsereturn false
        if (other.getKernelId() == null ^ this.getKernelId() == nullreturn false;
        if (other.getKernelId() != null && other.getKernelId().equals(this.getKernelId()) == falsereturn false
        if (other.getRamdiskId() == null ^ this.getRamdiskId() == nullreturn false;
        if (other.getRamdiskId() != null && other.getRamdiskId().equals(this.getRamdiskId()) == falsereturn false
        if (other.getPlatform() == null ^ this.getPlatform() == nullreturn false;
        if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == falsereturn false
        if (other.getSriovNetSupport() == null ^ this.getSriovNetSupport() == nullreturn false;
        if (other.getSriovNetSupport() != null && other.getSriovNetSupport().equals(this.getSriovNetSupport()) == falsereturn false
        if (other.getStateReason() == null ^ this.getStateReason() == nullreturn false;
        if (other.getStateReason() != null && other.getStateReason().equals(this.getStateReason()) == falsereturn false
        if (other.getImageOwnerAlias() == null ^ this.getImageOwnerAlias() == nullreturn false;
        if (other.getImageOwnerAlias() != null && other.getImageOwnerAlias().equals(this.getImageOwnerAlias()) == falsereturn false
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getRootDeviceType() == null ^ this.getRootDeviceType() == nullreturn false;
        if (other.getRootDeviceType() != null && other.getRootDeviceType().equals(this.getRootDeviceType()) == falsereturn false
        if (other.getRootDeviceName() == null ^ this.getRootDeviceName() == nullreturn false;
        if (other.getRootDeviceName() != null && other.getRootDeviceName().equals(this.getRootDeviceName()) == falsereturn false
        if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == nullreturn false;
        if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == falsereturn false
        if (other.getVirtualizationType() == null ^ this.getVirtualizationType() == nullreturn false;
        if (other.getVirtualizationType() != null && other.getVirtualizationType().equals(this.getVirtualizationType()) == falsereturn false
        if (other.getTags() == null ^ this.getTags() == nullreturn false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == falsereturn false
        if (other.getHypervisor() == null ^ this.getHypervisor() == nullreturn false;
        if (other.getHypervisor() != null && other.getHypervisor().equals(this.getHypervisor()) == falsereturn false
        return true;
    }
    
    @Override
    public Image clone() {
        try {
            return (Imagesuper.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