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 the launch specification for an instance.

  
  public class LaunchSpecification implements SerializableCloneable {

    
The ID of the AMI.
  
      private String imageId;

    
The name of the key pair.
  
      private String keyName;

    
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.
  
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.
  
The Base64-encoded MIME user data to make available to the instances.
  
      private String userData;

    
Deprecated.
  
      private String addressingType;

    
The instance type.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

  
      private String instanceType;

    
The placement information for the instance.
  
      private SpotPlacement placement;

    
The ID of the kernel.
  
      private String kernelId;

    
The ID of the RAM disk.
  
      private String ramdiskId;

    
One or more block device mapping entries.
  
Enables monitoring for the instance.

Default: Disabled

  
      private Boolean monitoringEnabled;

    
The ID of the subnet in which to launch the instance.
  
      private String subnetId;

    
One or more network interfaces.
 
The IAM instance profile.
 
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

 
     private Boolean ebsOptimized;

    
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 LaunchSpecification withImageId(String imageId) {
         this. = imageId;
         return this;
     }

    
The name of the key pair.

Returns:
The name of the key pair.
 
     public String getKeyName() {
         return ;
     }
    
    
The name of the key pair.

Parameters:
keyName The name of the key pair.
 
     public void setKeyName(String keyName) {
         this. = keyName;
     }
    
    
The name of the key pair.

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

Parameters:
keyName The name of the key pair.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withKeyName(String keyName) {
         this. = keyName;
         return this;
     }

    
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.

Returns:
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.
 
         if ( == null) {
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.

Parameters:
allSecurityGroups One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.
 
     public void setAllSecurityGroups(java.util.Collection<GroupIdentifierallSecurityGroups) {
         if (allSecurityGroups == null) {
             this. = null;
             return;
         }
         allSecurityGroupsCopy.addAll(allSecurityGroups);
         this. = allSecurityGroupsCopy;
     }
    
    
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.

NOTE: This method appends the values to the existing list (if any). Use setAllSecurityGroups(java.util.Collection) or withAllSecurityGroups(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:
allSecurityGroups One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withAllSecurityGroups(GroupIdentifier... allSecurityGroups) {
         if (getAllSecurityGroups() == nullsetAllSecurityGroups(new java.util.ArrayList<GroupIdentifier>(allSecurityGroups.length));
         for (GroupIdentifier value : allSecurityGroups) {
             getAllSecurityGroups().add(value);
         }
         return this;
     }
    
    
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.

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

Parameters:
allSecurityGroups One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (allSecurityGroups == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<GroupIdentifierallSecurityGroupsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<GroupIdentifier>(allSecurityGroups.size());
             allSecurityGroupsCopy.addAll(allSecurityGroups);
             this. = allSecurityGroupsCopy;
         }
 
         return this;
     }

    
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.

Returns:
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.
 
     public java.util.List<StringgetSecurityGroups() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.

Parameters:
securityGroups One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.
 
     public void setSecurityGroups(java.util.Collection<StringsecurityGroups) {
         if (securityGroups == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<StringsecurityGroupsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(securityGroups.size());
         securityGroupsCopy.addAll(securityGroups);
         this. = securityGroupsCopy;
     }
    
    
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.

NOTE: This method appends the values to the existing list (if any). Use setSecurityGroups(java.util.Collection) or withSecurityGroups(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:
securityGroups One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withSecurityGroups(String... securityGroups) {
         if (getSecurityGroups() == nullsetSecurityGroups(new java.util.ArrayList<String>(securityGroups.length));
         for (String value : securityGroups) {
             getSecurityGroups().add(value);
         }
         return this;
     }
    
    
One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.

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

Parameters:
securityGroups One or more security groups. To request an instance in a nondefault VPC, you must specify the ID of the security group. To request an instance in EC2-Classic or a default VPC, you can specify the name or the ID of the security group.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withSecurityGroups(java.util.Collection<StringsecurityGroups) {
         if (securityGroups == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringsecurityGroupsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(securityGroups.size());
             securityGroupsCopy.addAll(securityGroups);
             this. = securityGroupsCopy;
         }
 
         return this;
     }

    
The Base64-encoded MIME user data to make available to the instances.

Returns:
The Base64-encoded MIME user data to make available to the instances.
 
     public String getUserData() {
         return ;
     }
    
    
The Base64-encoded MIME user data to make available to the instances.

Parameters:
userData The Base64-encoded MIME user data to make available to the instances.
 
     public void setUserData(String userData) {
         this. = userData;
     }
    
    
The Base64-encoded MIME user data to make available to the instances.

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

Parameters:
userData The Base64-encoded MIME user data to make available to the instances.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withUserData(String userData) {
         this. = userData;
         return this;
     }

    
Deprecated.

Returns:
Deprecated.
 
     public String getAddressingType() {
         return ;
     }
    
    
Deprecated.

Parameters:
addressingType Deprecated.
 
     public void setAddressingType(String addressingType) {
         this. = addressingType;
     }
    
    
Deprecated.

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

Parameters:
addressingType Deprecated.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withAddressingType(String addressingType) {
         this. = addressingType;
         return this;
     }

    
The instance type.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Returns:
The instance type.
See also:
InstanceType
 
     public String getInstanceType() {
         return ;
     }
    
    
The instance type.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type.
See also:
InstanceType
 
     public void setInstanceType(String instanceType) {
         this. = instanceType;
     }
    
    
The instance type.

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

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceType
 
     public LaunchSpecification withInstanceType(String instanceType) {
         this. = instanceType;
         return this;
     }

    
The instance type.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type.
See also:
InstanceType
 
     public void setInstanceType(InstanceType instanceType) {
         this. = instanceType.toString();
     }
    
    
The instance type.

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

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceType
 
     public LaunchSpecification withInstanceType(InstanceType instanceType) {
         this. = instanceType.toString();
         return this;
     }

    
The placement information for the instance.

Returns:
The placement information for the instance.
 
     public SpotPlacement getPlacement() {
         return ;
     }
    
    
The placement information for the instance.

Parameters:
placement The placement information for the instance.
 
     public void setPlacement(SpotPlacement placement) {
         this. = placement;
     }
    
    
The placement information for the instance.

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

Parameters:
placement The placement information for the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withPlacement(SpotPlacement placement) {
         this. = placement;
         return this;
     }

    
The ID of the kernel.

Returns:
The ID of the kernel.
 
     public String getKernelId() {
         return ;
     }
    
    
The ID of the kernel.

Parameters:
kernelId The ID of the kernel.
 
     public void setKernelId(String kernelId) {
         this. = kernelId;
     }
    
    
The ID of the kernel.

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

Parameters:
kernelId The ID of the kernel.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withKernelId(String kernelId) {
         this. = kernelId;
         return this;
     }

    
The ID of the RAM disk.

Returns:
The ID of the RAM disk.
 
     public String getRamdiskId() {
         return ;
     }
    
    
The ID of the RAM disk.

Parameters:
ramdiskId The ID of the RAM disk.
 
     public void setRamdiskId(String ramdiskId) {
         this. = ramdiskId;
     }
    
    
The ID of the RAM disk.

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

Parameters:
ramdiskId The ID of the RAM disk.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withRamdiskId(String ramdiskId) {
         this. = ramdiskId;
         return this;
     }

    
One or more block device mapping entries.

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

Parameters:
blockDeviceMappings One or more block device mapping entries.
 
     public void setBlockDeviceMappings(java.util.Collection<BlockDeviceMappingblockDeviceMappings) {
         if (blockDeviceMappings == null) {
             this. = null;
             return;
         }
         blockDeviceMappingsCopy.addAll(blockDeviceMappings);
         this. = blockDeviceMappingsCopy;
     }
    
    
One or more 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 One or more block device mapping entries.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings) {
         if (getBlockDeviceMappings() == nullsetBlockDeviceMappings(new java.util.ArrayList<BlockDeviceMapping>(blockDeviceMappings.length));
         for (BlockDeviceMapping value : blockDeviceMappings) {
             getBlockDeviceMappings().add(value);
         }
         return this;
     }
    
    
One or more block device mapping entries.

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

Parameters:
blockDeviceMappings One or more block device mapping entries.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         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;
     }

    
Enables monitoring for the instance.

Default: Disabled

Returns:
Enables monitoring for the instance.

Default: Disabled

 
     public Boolean isMonitoringEnabled() {
         return ;
     }
    
    
Enables monitoring for the instance.

Default: Disabled

Parameters:
monitoringEnabled Enables monitoring for the instance.

Default: Disabled

 
     public void setMonitoringEnabled(Boolean monitoringEnabled) {
         this. = monitoringEnabled;
     }
    
    
Enables monitoring for the instance.

Default: Disabled

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

Parameters:
monitoringEnabled Enables monitoring for the instance.

Default: Disabled

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withMonitoringEnabled(Boolean monitoringEnabled) {
         this. = monitoringEnabled;
         return this;
     }

    
Enables monitoring for the instance.

Default: Disabled

Returns:
Enables monitoring for the instance.

Default: Disabled

 
     public Boolean getMonitoringEnabled() {
         return ;
     }

    
The ID of the subnet in which to launch the instance.

Returns:
The ID of the subnet in which to launch the instance.
 
     public String getSubnetId() {
         return ;
     }
    
    
The ID of the subnet in which to launch the instance.

Parameters:
subnetId The ID of the subnet in which to launch the instance.
 
     public void setSubnetId(String subnetId) {
         this. = subnetId;
     }
    
    
The ID of the subnet in which to launch the instance.

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

Parameters:
subnetId The ID of the subnet in which to launch the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withSubnetId(String subnetId) {
         this. = subnetId;
         return this;
     }

    
One or more network interfaces.

Returns:
One or more network interfaces.
 
         if ( == null) {
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
One or more network interfaces.

Parameters:
networkInterfaces One or more network interfaces.
 
     public void setNetworkInterfaces(java.util.Collection<InstanceNetworkInterfaceSpecificationnetworkInterfaces) {
         if (networkInterfaces == null) {
             this. = null;
             return;
         }
         networkInterfacesCopy.addAll(networkInterfaces);
         this. = networkInterfacesCopy;
     }
    
    
One or more network interfaces.

NOTE: This method appends the values to the existing list (if any). Use setNetworkInterfaces(java.util.Collection) or withNetworkInterfaces(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:
networkInterfaces One or more network interfaces.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (getNetworkInterfaces() == nullsetNetworkInterfaces(new java.util.ArrayList<InstanceNetworkInterfaceSpecification>(networkInterfaces.length));
         for (InstanceNetworkInterfaceSpecification value : networkInterfaces) {
             getNetworkInterfaces().add(value);
         }
         return this;
     }
    
    
One or more network interfaces.

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

Parameters:
networkInterfaces One or more network interfaces.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (networkInterfaces == null) {
             this. = null;
         } else {
             networkInterfacesCopy.addAll(networkInterfaces);
             this. = networkInterfacesCopy;
         }
 
         return this;
     }

    
The IAM instance profile.

Returns:
The IAM instance profile.
 
         return ;
     }
    
    
The IAM instance profile.

Parameters:
iamInstanceProfile The IAM instance profile.
 
     public void setIamInstanceProfile(IamInstanceProfileSpecification iamInstanceProfile) {
         this. = iamInstanceProfile;
     }
    
    
The IAM instance profile.

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

Parameters:
iamInstanceProfile The IAM instance profile.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         this. = iamInstanceProfile;
         return this;
     }

    
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

Returns:
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

 
     public Boolean isEbsOptimized() {
         return ;
     }
    
    
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

Parameters:
ebsOptimized Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

 
     public void setEbsOptimized(Boolean ebsOptimized) {
         this. = ebsOptimized;
     }
    
    
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

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

Parameters:
ebsOptimized Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LaunchSpecification withEbsOptimized(Boolean ebsOptimized) {
         this. = ebsOptimized;
         return this;
     }

    
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

Returns:
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

 
     public Boolean getEbsOptimized() {
         return ;
     }

    
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 (getKeyName() != nullsb.append("KeyName: " + getKeyName() + ",");
         if (getAllSecurityGroups() != nullsb.append("AllSecurityGroups: " + getAllSecurityGroups() + ",");
         if (getSecurityGroups() != nullsb.append("SecurityGroups: " + getSecurityGroups() + ",");
         if (getUserData() != nullsb.append("UserData: " + getUserData() + ",");
         if (getAddressingType() != nullsb.append("AddressingType: " + getAddressingType() + ",");
         if (getInstanceType() != nullsb.append("InstanceType: " + getInstanceType() + ",");
         if (getPlacement() != nullsb.append("Placement: " + getPlacement() + ",");
         if (getKernelId() != nullsb.append("KernelId: " + getKernelId() + ",");
         if (getRamdiskId() != nullsb.append("RamdiskId: " + getRamdiskId() + ",");
         if (getBlockDeviceMappings() != nullsb.append("BlockDeviceMappings: " + getBlockDeviceMappings() + ",");
         if (isMonitoringEnabled() != nullsb.append("MonitoringEnabled: " + isMonitoringEnabled() + ",");
         if (getSubnetId() != nullsb.append("SubnetId: " + getSubnetId() + ",");
         if (getNetworkInterfaces() != nullsb.append("NetworkInterfaces: " + getNetworkInterfaces() + ",");
         if (getIamInstanceProfile() != nullsb.append("IamInstanceProfile: " + getIamInstanceProfile() + ",");
         if (isEbsOptimized() != nullsb.append("EbsOptimized: " + isEbsOptimized() );
         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 + ((getKeyName() == null) ? 0 : getKeyName().hashCode()); 
        hashCode = prime * hashCode + ((getAllSecurityGroups() == null) ? 0 : getAllSecurityGroups().hashCode()); 
        hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); 
        hashCode = prime * hashCode + ((getUserData() == null) ? 0 : getUserData().hashCode()); 
        hashCode = prime * hashCode + ((getAddressingType() == null) ? 0 : getAddressingType().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); 
        hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode()); 
        hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode()); 
        hashCode = prime * hashCode + ((getRamdiskId() == null) ? 0 : getRamdiskId().hashCode()); 
        hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); 
        hashCode = prime * hashCode + ((isMonitoringEnabled() == null) ? 0 : isMonitoringEnabled().hashCode()); 
        hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode()); 
        hashCode = prime * hashCode + ((getNetworkInterfaces() == null) ? 0 : getNetworkInterfaces().hashCode()); 
        hashCode = prime * hashCode + ((getIamInstanceProfile() == null) ? 0 : getIamInstanceProfile().hashCode()); 
        hashCode = prime * hashCode + ((isEbsOptimized() == null) ? 0 : isEbsOptimized().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof LaunchSpecification == falsereturn false;
        LaunchSpecification other = (LaunchSpecification)obj;
        
        if (other.getImageId() == null ^ this.getImageId() == nullreturn false;
        if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == falsereturn false
        if (other.getKeyName() == null ^ this.getKeyName() == nullreturn false;
        if (other.getKeyName() != null && other.getKeyName().equals(this.getKeyName()) == falsereturn false
        if (other.getAllSecurityGroups() == null ^ this.getAllSecurityGroups() == nullreturn false;
        if (other.getAllSecurityGroups() != null && other.getAllSecurityGroups().equals(this.getAllSecurityGroups()) == falsereturn false
        if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == nullreturn false;
        if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == falsereturn false
        if (other.getUserData() == null ^ this.getUserData() == nullreturn false;
        if (other.getUserData() != null && other.getUserData().equals(this.getUserData()) == falsereturn false
        if (other.getAddressingType() == null ^ this.getAddressingType() == nullreturn false;
        if (other.getAddressingType() != null && other.getAddressingType().equals(this.getAddressingType()) == falsereturn false
        if (other.getInstanceType() == null ^ this.getInstanceType() == nullreturn false;
        if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == falsereturn false
        if (other.getPlacement() == null ^ this.getPlacement() == nullreturn false;
        if (other.getPlacement() != null && other.getPlacement().equals(this.getPlacement()) == 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.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == nullreturn false;
        if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == falsereturn false
        if (other.isMonitoringEnabled() == null ^ this.isMonitoringEnabled() == nullreturn false;
        if (other.isMonitoringEnabled() != null && other.isMonitoringEnabled().equals(this.isMonitoringEnabled()) == falsereturn false
        if (other.getSubnetId() == null ^ this.getSubnetId() == nullreturn false;
        if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == falsereturn false
        if (other.getNetworkInterfaces() == null ^ this.getNetworkInterfaces() == nullreturn false;
        if (other.getNetworkInterfaces() != null && other.getNetworkInterfaces().equals(this.getNetworkInterfaces()) == falsereturn false
        if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == nullreturn false;
        if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == falsereturn false
        if (other.isEbsOptimized() == null ^ this.isEbsOptimized() == nullreturn false;
        if (other.isEbsOptimized() != null && other.isEbsOptimized().equals(this.isEbsOptimized()) == falsereturn false
        return true;
    }
    
    @Override
    public LaunchSpecification clone() {
        try {
            return (LaunchSpecificationsuper.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