Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2014 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;
 
 
 public class ImportInstanceLaunchSpecification implements Serializable {

    
The architecture of the instance.

Constraints:
Allowed Values: i386, x86_64

 
     private String architecture;

    
One or more security group names.
 
 
     private String additionalInfo;

    
User data to be made available to the instance.
 
     private String userData;

    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, 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, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge

 
     private String instanceType;

    
 
     private Placement placement;

    
 
     private Boolean monitoring;

    
[EC2-VPC] The ID of the subnet to launch the instance into.
 
     private String subnetId;

    
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Constraints:
Allowed Values: stop, terminate

 
     private String instanceInitiatedShutdownBehavior;

    
[EC2-VPC] Optionally, you can use this parameter to assign the instance a specific available IP address from the IP address range of the subnet.
 
     private String privateIpAddress;

    
The architecture of the instance.

Constraints:
Allowed Values: i386, x86_64

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

Constraints:
Allowed Values: i386, x86_64

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

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 instance.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ArchitectureValues
        this. = architecture;
        return this;
    }

    
The architecture of the instance.

Constraints:
Allowed Values: i386, x86_64

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

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 instance.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ArchitectureValues
    public ImportInstanceLaunchSpecification withArchitecture(ArchitectureValues architecture) {
        this. = architecture.toString();
        return this;
    }

    
One or more security group names.

Returns:
One or more security group names.
    public java.util.List<StringgetGroupNames() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more security group names.

Parameters:
groupNames One or more security group names.
    public void setGroupNames(java.util.Collection<StringgroupNames) {
        if (groupNames == null) {
            this. = null;
            return;
        }
        groupNamesCopy.addAll(groupNames);
        this. = groupNamesCopy;
    }
    
    
One or more security group names.

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

Parameters:
groupNames One or more security group names.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ImportInstanceLaunchSpecification withGroupNames(String... groupNames) {
        if (getGroupNames() == nullsetGroupNames(new java.util.ArrayList<String>(groupNames.length));
        for (String value : groupNames) {
            getGroupNames().add(value);
        }
        return this;
    }
    
    
One or more security group names.

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

Parameters:
groupNames One or more security group names.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (groupNames == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringgroupNamesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(groupNames.size());
            groupNamesCopy.addAll(groupNames);
            this. = groupNamesCopy;
        }
        return this;
    }

    

Returns:
    public String getAdditionalInfo() {
        return ;
    }
    
    

Parameters:
additionalInfo
    public void setAdditionalInfo(String additionalInfo) {
        this. = additionalInfo;
    }
    
    

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

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

    
User data to be made available to the instance.

Returns:
User data to be made available to the instance.
    public String getUserData() {
        return ;
    }
    
    
User data to be made available to the instance.

Parameters:
userData User data to be made available to the instance.
    public void setUserData(String userData) {
        this. = userData;
    }
    
    
User data to be made available to the instance.

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

Parameters:
userData User data to be made available to the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = userData;
        return this;
    }

    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, 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, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge

Returns:
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
See also:
InstanceType
    public String getInstanceType() {
        return ;
    }
    
    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, 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, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge

Parameters:
instanceType The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
See also:
InstanceType
    public void setInstanceType(String instanceType) {
        this. = instanceType;
    }
    
    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

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, 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, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge

Parameters:
instanceType The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceType
        this. = instanceType;
        return this;
    }

    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, 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, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge

Parameters:
instanceType The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
See also:
InstanceType
    public void setInstanceType(InstanceType instanceType) {
        this. = instanceType.toString();
    }
    
    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

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, 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, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge

Parameters:
instanceType The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceType
    public ImportInstanceLaunchSpecification withInstanceType(InstanceType instanceType) {
        this. = instanceType.toString();
        return this;
    }

    

Returns:
    public Placement getPlacement() {
        return ;
    }
    
    

Parameters:
placement
    public void setPlacement(Placement placement) {
        this. = placement;
    }
    
    

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

Parameters:
placement
Returns:
A reference to this updated object so that method calls can be chained together.
    public ImportInstanceLaunchSpecification withPlacement(Placement placement) {
        this. = placement;
        return this;
    }

    

Returns:
    public Boolean isMonitoring() {
        return ;
    }
    
    

Parameters:
monitoring
    public void setMonitoring(Boolean monitoring) {
        this. = monitoring;
    }
    
    

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

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

    

Returns:
    public Boolean getMonitoring() {
        return ;
    }

    
[EC2-VPC] The ID of the subnet to launch the instance into.

Returns:
[EC2-VPC] The ID of the subnet to launch the instance into.
    public String getSubnetId() {
        return ;
    }
    
    
[EC2-VPC] The ID of the subnet to launch the instance into.

Parameters:
subnetId [EC2-VPC] The ID of the subnet to launch the instance into.
    public void setSubnetId(String subnetId) {
        this. = subnetId;
    }
    
    
[EC2-VPC] The ID of the subnet to launch the instance into.

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

Parameters:
subnetId [EC2-VPC] The ID of the subnet to launch the instance into.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = subnetId;
        return this;
    }

    
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Constraints:
Allowed Values: stop, terminate

Returns:
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
See also:
ShutdownBehavior
        return ;
    }
    
    
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Constraints:
Allowed Values: stop, terminate

Parameters:
instanceInitiatedShutdownBehavior Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
See also:
ShutdownBehavior
    public void setInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) {
        this. = instanceInitiatedShutdownBehavior;
    }
    
    
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

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

Constraints:
Allowed Values: stop, terminate

Parameters:
instanceInitiatedShutdownBehavior Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ShutdownBehavior
    public ImportInstanceLaunchSpecification withInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) {
        this. = instanceInitiatedShutdownBehavior;
        return this;
    }

    
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Constraints:
Allowed Values: stop, terminate

Parameters:
instanceInitiatedShutdownBehavior Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
See also:
ShutdownBehavior
    public void setInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior) {
        this. = instanceInitiatedShutdownBehavior.toString();
    }
    
    
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

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

Constraints:
Allowed Values: stop, terminate

Parameters:
instanceInitiatedShutdownBehavior Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ShutdownBehavior
    public ImportInstanceLaunchSpecification withInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior) {
        this. = instanceInitiatedShutdownBehavior.toString();
        return this;
    }

    
[EC2-VPC] Optionally, you can use this parameter to assign the instance a specific available IP address from the IP address range of the subnet.

Returns:
[EC2-VPC] Optionally, you can use this parameter to assign the instance a specific available IP address from the IP address range of the subnet.
    public String getPrivateIpAddress() {
        return ;
    }
    
    
[EC2-VPC] Optionally, you can use this parameter to assign the instance a specific available IP address from the IP address range of the subnet.

Parameters:
privateIpAddress [EC2-VPC] Optionally, you can use this parameter to assign the instance a specific available IP address from the IP address range of the subnet.
    public void setPrivateIpAddress(String privateIpAddress) {
        this. = privateIpAddress;
    }
    
    
[EC2-VPC] Optionally, you can use this parameter to assign the instance a specific available IP address from the IP address range of the subnet.

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

Parameters:
privateIpAddress [EC2-VPC] Optionally, you can use this parameter to assign the instance a specific available IP address from the IP address range of the subnet.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = privateIpAddress;
        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 (getArchitecture() != nullsb.append("Architecture: " + getArchitecture() + ",");
        if (getGroupNames() != nullsb.append("GroupNames: " + getGroupNames() + ",");
        if (getAdditionalInfo() != nullsb.append("AdditionalInfo: " + getAdditionalInfo() + ",");
        if (getUserData() != nullsb.append("UserData: " + getUserData() + ",");
        if (getInstanceType() != nullsb.append("InstanceType: " + getInstanceType() + ",");
        if (getPlacement() != nullsb.append("Placement: " + getPlacement() + ",");
        if (isMonitoring() != nullsb.append("Monitoring: " + isMonitoring() + ",");
        if (getSubnetId() != nullsb.append("SubnetId: " + getSubnetId() + ",");
        if (getInstanceInitiatedShutdownBehavior() != nullsb.append("InstanceInitiatedShutdownBehavior: " + getInstanceInitiatedShutdownBehavior() + ",");
        if (getPrivateIpAddress() != nullsb.append("PrivateIpAddress: " + getPrivateIpAddress() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode()); 
        hashCode = prime * hashCode + ((getGroupNames() == null) ? 0 : getGroupNames().hashCode()); 
        hashCode = prime * hashCode + ((getAdditionalInfo() == null) ? 0 : getAdditionalInfo().hashCode()); 
        hashCode = prime * hashCode + ((getUserData() == null) ? 0 : getUserData().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); 
        hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode()); 
        hashCode = prime * hashCode + ((isMonitoring() == null) ? 0 : isMonitoring().hashCode()); 
        hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceInitiatedShutdownBehavior() == null) ? 0 : getInstanceInitiatedShutdownBehavior().hashCode()); 
        hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ImportInstanceLaunchSpecification == falsereturn false;
        
        if (other.getArchitecture() == null ^ this.getArchitecture() == nullreturn false;
        if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == falsereturn false
        if (other.getGroupNames() == null ^ this.getGroupNames() == nullreturn false;
        if (other.getGroupNames() != null && other.getGroupNames().equals(this.getGroupNames()) == falsereturn false
        if (other.getAdditionalInfo() == null ^ this.getAdditionalInfo() == nullreturn false;
        if (other.getAdditionalInfo() != null && other.getAdditionalInfo().equals(this.getAdditionalInfo()) == falsereturn false
        if (other.getUserData() == null ^ this.getUserData() == nullreturn false;
        if (other.getUserData() != null && other.getUserData().equals(this.getUserData()) == 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.isMonitoring() == null ^ this.isMonitoring() == nullreturn false;
        if (other.isMonitoring() != null && other.isMonitoring().equals(this.isMonitoring()) == falsereturn false
        if (other.getSubnetId() == null ^ this.getSubnetId() == nullreturn false;
        if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == falsereturn false
        if (other.getInstanceInitiatedShutdownBehavior() == null ^ this.getInstanceInitiatedShutdownBehavior() == nullreturn false;
        if (other.getInstanceInitiatedShutdownBehavior() != null && other.getInstanceInitiatedShutdownBehavior().equals(this.getInstanceInitiatedShutdownBehavior()) == falsereturn false
        if (other.getPrivateIpAddress() == null ^ this.getPrivateIpAddress() == nullreturn false;
        if (other.getPrivateIpAddress() != null && other.getPrivateIpAddress().equals(this.getPrivateIpAddress()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X