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;
 
 
Container for the parameters to the ImportInstance operation.

Creates an import instance task using metadata from the specified disk image. ImportInstance only supports single-volume VMs. To import multi-volume VMs, use ImportImage. After importing the image, you then upload it using the ec2-import-volume command in the EC2 command line tools. For more information, see Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 in the Amazon Elastic Compute Cloud User Guide for Linux .

 
A description for the instance being imported.
 
     private String description;

    
The launch specification.
 
The disk image.
 
The instance operating system.

Constraints:
Allowed Values: Windows

 
     private String platform;

    
A description for the instance being imported.

Returns:
A description for the instance being imported.
 
     public String getDescription() {
         return ;
     }
    
    
A description for the instance being imported.

Parameters:
description A description for the instance being imported.
 
     public void setDescription(String description) {
         this. = description;
     }
    
    
A description for the instance being imported.

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

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

    
The launch specification.

Returns:
The launch specification.
 
        return ;
    }
    
    
The launch specification.

Parameters:
launchSpecification The launch specification.
    public void setLaunchSpecification(ImportInstanceLaunchSpecification launchSpecification) {
        this. = launchSpecification;
    }
    
    
The launch specification.

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

Parameters:
launchSpecification The launch specification.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = launchSpecification;
        return this;
    }

    
The disk image.

Returns:
The disk image.
    public java.util.List<DiskImagegetDiskImages() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<DiskImage>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The disk image.

Parameters:
diskImages The disk image.
    public void setDiskImages(java.util.Collection<DiskImagediskImages) {
        if (diskImages == null) {
            this. = null;
            return;
        }
        diskImagesCopy.addAll(diskImages);
        this. = diskImagesCopy;
    }
    
    
The disk image.

NOTE: This method appends the values to the existing list (if any). Use setDiskImages(java.util.Collection) or withDiskImages(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:
diskImages The disk image.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ImportInstanceRequest withDiskImages(DiskImage... diskImages) {
        if (getDiskImages() == nullsetDiskImages(new java.util.ArrayList<DiskImage>(diskImages.length));
        for (DiskImage value : diskImages) {
            getDiskImages().add(value);
        }
        return this;
    }
    
    
The disk image.

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

Parameters:
diskImages The disk image.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (diskImages == null) {
            this. = null;
        } else {
            diskImagesCopy.addAll(diskImages);
            this. = diskImagesCopy;
        }
        return this;
    }

    
The instance operating system.

Constraints:
Allowed Values: Windows

Returns:
The instance operating system.
See also:
PlatformValues
    public String getPlatform() {
        return ;
    }
    
    
The instance operating system.

Constraints:
Allowed Values: Windows

Parameters:
platform The instance operating system.
See also:
PlatformValues
    public void setPlatform(String platform) {
        this. = platform;
    }
    
    
The instance operating system.

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

Constraints:
Allowed Values: Windows

Parameters:
platform The instance operating system.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
PlatformValues
    public ImportInstanceRequest withPlatform(String platform) {
        this. = platform;
        return this;
    }

    
The instance operating system.

Constraints:
Allowed Values: Windows

Parameters:
platform The instance operating system.
See also:
PlatformValues
    public void setPlatform(PlatformValues platform) {
        this. = platform.toString();
    }
    
    
The instance operating system.

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

Constraints:
Allowed Values: Windows

Parameters:
platform The instance operating system.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
PlatformValues
        this. = platform.toString();
        return this;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        Request<ImportInstanceRequestrequest = new ImportInstanceRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
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 (getLaunchSpecification() != nullsb.append("LaunchSpecification: " + getLaunchSpecification() + ",");
        if (getDiskImages() != nullsb.append("DiskImages: " + getDiskImages() + ",");
        if (getPlatform() != nullsb.append("Platform: " + getPlatform() );
        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 + ((getLaunchSpecification() == null) ? 0 : getLaunchSpecification().hashCode()); 
        hashCode = prime * hashCode + ((getDiskImages() == null) ? 0 : getDiskImages().hashCode()); 
        hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ImportInstanceRequest == falsereturn false;
        ImportInstanceRequest other = (ImportInstanceRequest)obj;
        
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getLaunchSpecification() == null ^ this.getLaunchSpecification() == nullreturn false;
        if (other.getLaunchSpecification() != null && other.getLaunchSpecification().equals(this.getLaunchSpecification()) == falsereturn false
        if (other.getDiskImages() == null ^ this.getDiskImages() == nullreturn false;
        if (other.getDiskImages() != null && other.getDiskImages().equals(this.getDiskImages()) == falsereturn false
        if (other.getPlatform() == null ^ this.getPlatform() == nullreturn false;
        if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == falsereturn false
        return true;
    }
    
    @Override
    public ImportInstanceRequest clone() {
        
            return (ImportInstanceRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X