com.amazonaws.services.ec2.model.ImportInstanceLaunchSpecification Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2019-2024 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;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes the launch specification for VM import.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ImportInstanceLaunchSpecification implements Serializable, Cloneable {
/**
*
* Reserved.
*
*/
private String additionalInfo;
/**
*
* The architecture of the instance.
*
*/
private String architecture;
/**
*
* The security group IDs.
*
*/
private com.amazonaws.internal.SdkInternalList groupIds;
/**
*
* The security group names.
*
*/
private com.amazonaws.internal.SdkInternalList groupNames;
/**
*
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
*
*/
private String instanceInitiatedShutdownBehavior;
/**
*
* The instance type. For more information about the instance types that you can import, see Instance
* Types in the VM Import/Export User Guide.
*
*/
private String instanceType;
/**
*
* Indicates whether monitoring is enabled.
*
*/
private Boolean monitoring;
/**
*
* The placement information for the instance.
*
*/
private Placement placement;
/**
*
* [EC2-VPC] An available IP address from the IP address range of the subnet.
*
*/
private String privateIpAddress;
/**
*
* [EC2-VPC] The ID of the subnet in which to launch the instance.
*
*/
private String subnetId;
/**
*
* The Base64-encoded user data to make available to the instance.
*
*/
private UserData userData;
/**
*
* Reserved.
*
*
* @param additionalInfo
* Reserved.
*/
public void setAdditionalInfo(String additionalInfo) {
this.additionalInfo = additionalInfo;
}
/**
*
* Reserved.
*
*
* @return Reserved.
*/
public String getAdditionalInfo() {
return this.additionalInfo;
}
/**
*
* Reserved.
*
*
* @param additionalInfo
* Reserved.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportInstanceLaunchSpecification withAdditionalInfo(String additionalInfo) {
setAdditionalInfo(additionalInfo);
return this;
}
/**
*
* The architecture of the instance.
*
*
* @param architecture
* The architecture of the instance.
* @see ArchitectureValues
*/
public void setArchitecture(String architecture) {
this.architecture = architecture;
}
/**
*
* The architecture of the instance.
*
*
* @return The architecture of the instance.
* @see ArchitectureValues
*/
public String getArchitecture() {
return this.architecture;
}
/**
*
* The architecture of the instance.
*
*
* @param architecture
* The architecture of the instance.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ArchitectureValues
*/
public ImportInstanceLaunchSpecification withArchitecture(String architecture) {
setArchitecture(architecture);
return this;
}
/**
*
* The architecture of the instance.
*
*
* @param architecture
* The architecture of the instance.
* @see ArchitectureValues
*/
public void setArchitecture(ArchitectureValues architecture) {
withArchitecture(architecture);
}
/**
*
* The architecture of the instance.
*
*
* @param architecture
* The architecture of the instance.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ArchitectureValues
*/
public ImportInstanceLaunchSpecification withArchitecture(ArchitectureValues architecture) {
this.architecture = architecture.toString();
return this;
}
/**
*
* The security group IDs.
*
*
* @return The security group IDs.
*/
public java.util.List getGroupIds() {
if (groupIds == null) {
groupIds = new com.amazonaws.internal.SdkInternalList();
}
return groupIds;
}
/**
*
* The security group IDs.
*
*
* @param groupIds
* The security group IDs.
*/
public void setGroupIds(java.util.Collection groupIds) {
if (groupIds == null) {
this.groupIds = null;
return;
}
this.groupIds = new com.amazonaws.internal.SdkInternalList(groupIds);
}
/**
*
* The security group IDs.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setGroupIds(java.util.Collection)} or {@link #withGroupIds(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param groupIds
* The security group IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportInstanceLaunchSpecification withGroupIds(String... groupIds) {
if (this.groupIds == null) {
setGroupIds(new com.amazonaws.internal.SdkInternalList(groupIds.length));
}
for (String ele : groupIds) {
this.groupIds.add(ele);
}
return this;
}
/**
*
* The security group IDs.
*
*
* @param groupIds
* The security group IDs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportInstanceLaunchSpecification withGroupIds(java.util.Collection groupIds) {
setGroupIds(groupIds);
return this;
}
/**
*
* The security group names.
*
*
* @return The security group names.
*/
public java.util.List getGroupNames() {
if (groupNames == null) {
groupNames = new com.amazonaws.internal.SdkInternalList();
}
return groupNames;
}
/**
*
* The security group names.
*
*
* @param groupNames
* The security group names.
*/
public void setGroupNames(java.util.Collection groupNames) {
if (groupNames == null) {
this.groupNames = null;
return;
}
this.groupNames = new com.amazonaws.internal.SdkInternalList(groupNames);
}
/**
*
* The security group names.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setGroupNames(java.util.Collection)} or {@link #withGroupNames(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param groupNames
* The security group names.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportInstanceLaunchSpecification withGroupNames(String... groupNames) {
if (this.groupNames == null) {
setGroupNames(new com.amazonaws.internal.SdkInternalList(groupNames.length));
}
for (String ele : groupNames) {
this.groupNames.add(ele);
}
return this;
}
/**
*
* The security group names.
*
*
* @param groupNames
* The security group names.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportInstanceLaunchSpecification withGroupNames(java.util.Collection groupNames) {
setGroupNames(groupNames);
return this;
}
/**
*
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
*
*
* @param instanceInitiatedShutdownBehavior
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
* @see ShutdownBehavior
*/
public void setInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) {
this.instanceInitiatedShutdownBehavior = instanceInitiatedShutdownBehavior;
}
/**
*
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
*
*
* @return Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
* @see ShutdownBehavior
*/
public String getInstanceInitiatedShutdownBehavior() {
return this.instanceInitiatedShutdownBehavior;
}
/**
*
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
*
*
* @param instanceInitiatedShutdownBehavior
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
* @return Returns a reference to this object so that method calls can be chained together.
* @see ShutdownBehavior
*/
public ImportInstanceLaunchSpecification withInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) {
setInstanceInitiatedShutdownBehavior(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).
*
*
* @param instanceInitiatedShutdownBehavior
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
* @see ShutdownBehavior
*/
public void setInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior) {
withInstanceInitiatedShutdownBehavior(instanceInitiatedShutdownBehavior);
}
/**
*
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
*
*
* @param instanceInitiatedShutdownBehavior
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
* @return Returns a reference to this object so that method calls can be chained together.
* @see ShutdownBehavior
*/
public ImportInstanceLaunchSpecification withInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior) {
this.instanceInitiatedShutdownBehavior = instanceInitiatedShutdownBehavior.toString();
return this;
}
/**
*
* The instance type. For more information about the instance types that you can import, see Instance
* Types in the VM Import/Export User Guide.
*
*
* @param instanceType
* The instance type. For more information about the instance types that you can import, see Instance Types in the VM Import/Export User Guide.
* @see InstanceType
*/
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
/**
*
* The instance type. For more information about the instance types that you can import, see Instance
* Types in the VM Import/Export User Guide.
*
*
* @return The instance type. For more information about the instance types that you can import, see Instance Types in the VM Import/Export User Guide.
* @see InstanceType
*/
public String getInstanceType() {
return this.instanceType;
}
/**
*
* The instance type. For more information about the instance types that you can import, see Instance
* Types in the VM Import/Export User Guide.
*
*
* @param instanceType
* The instance type. For more information about the instance types that you can import, see Instance Types in the VM Import/Export User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceType
*/
public ImportInstanceLaunchSpecification withInstanceType(String instanceType) {
setInstanceType(instanceType);
return this;
}
/**
*
* The instance type. For more information about the instance types that you can import, see Instance
* Types in the VM Import/Export User Guide.
*
*
* @param instanceType
* The instance type. For more information about the instance types that you can import, see Instance Types in the VM Import/Export User Guide.
* @see InstanceType
*/
public void setInstanceType(InstanceType instanceType) {
withInstanceType(instanceType);
}
/**
*
* The instance type. For more information about the instance types that you can import, see Instance
* Types in the VM Import/Export User Guide.
*
*
* @param instanceType
* The instance type. For more information about the instance types that you can import, see Instance Types in the VM Import/Export User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceType
*/
public ImportInstanceLaunchSpecification withInstanceType(InstanceType instanceType) {
this.instanceType = instanceType.toString();
return this;
}
/**
*
* Indicates whether monitoring is enabled.
*
*
* @param monitoring
* Indicates whether monitoring is enabled.
*/
public void setMonitoring(Boolean monitoring) {
this.monitoring = monitoring;
}
/**
*
* Indicates whether monitoring is enabled.
*
*
* @return Indicates whether monitoring is enabled.
*/
public Boolean getMonitoring() {
return this.monitoring;
}
/**
*
* Indicates whether monitoring is enabled.
*
*
* @param monitoring
* Indicates whether monitoring is enabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportInstanceLaunchSpecification withMonitoring(Boolean monitoring) {
setMonitoring(monitoring);
return this;
}
/**
*
* Indicates whether monitoring is enabled.
*
*
* @return Indicates whether monitoring is enabled.
*/
public Boolean isMonitoring() {
return this.monitoring;
}
/**
*
* The placement information for the instance.
*
*
* @param placement
* The placement information for the instance.
*/
public void setPlacement(Placement placement) {
this.placement = placement;
}
/**
*
* The placement information for the instance.
*
*
* @return The placement information for the instance.
*/
public Placement getPlacement() {
return this.placement;
}
/**
*
* The placement information for the instance.
*
*
* @param placement
* The placement information for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportInstanceLaunchSpecification withPlacement(Placement placement) {
setPlacement(placement);
return this;
}
/**
*
* [EC2-VPC] An available IP address from the IP address range of the subnet.
*
*
* @param privateIpAddress
* [EC2-VPC] An available IP address from the IP address range of the subnet.
*/
public void setPrivateIpAddress(String privateIpAddress) {
this.privateIpAddress = privateIpAddress;
}
/**
*
* [EC2-VPC] An available IP address from the IP address range of the subnet.
*
*
* @return [EC2-VPC] An available IP address from the IP address range of the subnet.
*/
public String getPrivateIpAddress() {
return this.privateIpAddress;
}
/**
*
* [EC2-VPC] An available IP address from the IP address range of the subnet.
*
*
* @param privateIpAddress
* [EC2-VPC] An available IP address from the IP address range of the subnet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportInstanceLaunchSpecification withPrivateIpAddress(String privateIpAddress) {
setPrivateIpAddress(privateIpAddress);
return this;
}
/**
*
* [EC2-VPC] The ID of the subnet in which to launch the instance.
*
*
* @param subnetId
* [EC2-VPC] The ID of the subnet in which to launch the instance.
*/
public void setSubnetId(String subnetId) {
this.subnetId = subnetId;
}
/**
*
* [EC2-VPC] The ID of the subnet in which to launch the instance.
*
*
* @return [EC2-VPC] The ID of the subnet in which to launch the instance.
*/
public String getSubnetId() {
return this.subnetId;
}
/**
*
* [EC2-VPC] The ID of the subnet in which to launch the instance.
*
*
* @param subnetId
* [EC2-VPC] The ID of the subnet in which to launch the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportInstanceLaunchSpecification withSubnetId(String subnetId) {
setSubnetId(subnetId);
return this;
}
/**
*
* The Base64-encoded user data to make available to the instance.
*
*
* @param userData
* The Base64-encoded user data to make available to the instance.
*/
public void setUserData(UserData userData) {
this.userData = userData;
}
/**
*
* The Base64-encoded user data to make available to the instance.
*
*
* @return The Base64-encoded user data to make available to the instance.
*/
public UserData getUserData() {
return this.userData;
}
/**
*
* The Base64-encoded user data to make available to the instance.
*
*
* @param userData
* The Base64-encoded user data to make available to the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportInstanceLaunchSpecification withUserData(UserData userData) {
setUserData(userData);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAdditionalInfo() != null)
sb.append("AdditionalInfo: ").append(getAdditionalInfo()).append(",");
if (getArchitecture() != null)
sb.append("Architecture: ").append(getArchitecture()).append(",");
if (getGroupIds() != null)
sb.append("GroupIds: ").append(getGroupIds()).append(",");
if (getGroupNames() != null)
sb.append("GroupNames: ").append(getGroupNames()).append(",");
if (getInstanceInitiatedShutdownBehavior() != null)
sb.append("InstanceInitiatedShutdownBehavior: ").append(getInstanceInitiatedShutdownBehavior()).append(",");
if (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getMonitoring() != null)
sb.append("Monitoring: ").append(getMonitoring()).append(",");
if (getPlacement() != null)
sb.append("Placement: ").append(getPlacement()).append(",");
if (getPrivateIpAddress() != null)
sb.append("PrivateIpAddress: ").append(getPrivateIpAddress()).append(",");
if (getSubnetId() != null)
sb.append("SubnetId: ").append(getSubnetId()).append(",");
if (getUserData() != null)
sb.append("UserData: ").append("***Sensitive Data Redacted***");
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ImportInstanceLaunchSpecification == false)
return false;
ImportInstanceLaunchSpecification other = (ImportInstanceLaunchSpecification) obj;
if (other.getAdditionalInfo() == null ^ this.getAdditionalInfo() == null)
return false;
if (other.getAdditionalInfo() != null && other.getAdditionalInfo().equals(this.getAdditionalInfo()) == false)
return false;
if (other.getArchitecture() == null ^ this.getArchitecture() == null)
return false;
if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == false)
return false;
if (other.getGroupIds() == null ^ this.getGroupIds() == null)
return false;
if (other.getGroupIds() != null && other.getGroupIds().equals(this.getGroupIds()) == false)
return false;
if (other.getGroupNames() == null ^ this.getGroupNames() == null)
return false;
if (other.getGroupNames() != null && other.getGroupNames().equals(this.getGroupNames()) == false)
return false;
if (other.getInstanceInitiatedShutdownBehavior() == null ^ this.getInstanceInitiatedShutdownBehavior() == null)
return false;
if (other.getInstanceInitiatedShutdownBehavior() != null
&& other.getInstanceInitiatedShutdownBehavior().equals(this.getInstanceInitiatedShutdownBehavior()) == false)
return false;
if (other.getInstanceType() == null ^ this.getInstanceType() == null)
return false;
if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false)
return false;
if (other.getMonitoring() == null ^ this.getMonitoring() == null)
return false;
if (other.getMonitoring() != null && other.getMonitoring().equals(this.getMonitoring()) == false)
return false;
if (other.getPlacement() == null ^ this.getPlacement() == null)
return false;
if (other.getPlacement() != null && other.getPlacement().equals(this.getPlacement()) == false)
return false;
if (other.getPrivateIpAddress() == null ^ this.getPrivateIpAddress() == null)
return false;
if (other.getPrivateIpAddress() != null && other.getPrivateIpAddress().equals(this.getPrivateIpAddress()) == false)
return false;
if (other.getSubnetId() == null ^ this.getSubnetId() == null)
return false;
if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == false)
return false;
if (other.getUserData() == null ^ this.getUserData() == null)
return false;
if (other.getUserData() != null && other.getUserData().equals(this.getUserData()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAdditionalInfo() == null) ? 0 : getAdditionalInfo().hashCode());
hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode());
hashCode = prime * hashCode + ((getGroupIds() == null) ? 0 : getGroupIds().hashCode());
hashCode = prime * hashCode + ((getGroupNames() == null) ? 0 : getGroupNames().hashCode());
hashCode = prime * hashCode + ((getInstanceInitiatedShutdownBehavior() == null) ? 0 : getInstanceInitiatedShutdownBehavior().hashCode());
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getMonitoring() == null) ? 0 : getMonitoring().hashCode());
hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode());
hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress().hashCode());
hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode());
hashCode = prime * hashCode + ((getUserData() == null) ? 0 : getUserData().hashCode());
return hashCode;
}
@Override
public ImportInstanceLaunchSpecification clone() {
try {
return (ImportInstanceLaunchSpecification) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}