![JAR search and dependency download from the Maven repository](/logo.png)
com.amazonaws.services.ec2.model.InstanceRequirementsWithMetadataRequest 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;
/**
*
* The architecture type, virtualization type, and other attributes for the instance types. When you specify instance
* attributes, Amazon EC2 will identify instance types with those attributes.
*
*
* If you specify InstanceRequirementsWithMetadataRequest
, you can't specify InstanceTypes
.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class InstanceRequirementsWithMetadataRequest implements Serializable, Cloneable {
/**
*
* The architecture type.
*
*/
private com.amazonaws.internal.SdkInternalList architectureTypes;
/**
*
* The virtualization type.
*
*/
private com.amazonaws.internal.SdkInternalList virtualizationTypes;
/**
*
* The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance
* types with those attributes.
*
*/
private InstanceRequirementsRequest instanceRequirements;
/**
*
* The architecture type.
*
*
* @return The architecture type.
* @see ArchitectureType
*/
public java.util.List getArchitectureTypes() {
if (architectureTypes == null) {
architectureTypes = new com.amazonaws.internal.SdkInternalList();
}
return architectureTypes;
}
/**
*
* The architecture type.
*
*
* @param architectureTypes
* The architecture type.
* @see ArchitectureType
*/
public void setArchitectureTypes(java.util.Collection architectureTypes) {
if (architectureTypes == null) {
this.architectureTypes = null;
return;
}
this.architectureTypes = new com.amazonaws.internal.SdkInternalList(architectureTypes);
}
/**
*
* The architecture type.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setArchitectureTypes(java.util.Collection)} or {@link #withArchitectureTypes(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param architectureTypes
* The architecture type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ArchitectureType
*/
public InstanceRequirementsWithMetadataRequest withArchitectureTypes(String... architectureTypes) {
if (this.architectureTypes == null) {
setArchitectureTypes(new com.amazonaws.internal.SdkInternalList(architectureTypes.length));
}
for (String ele : architectureTypes) {
this.architectureTypes.add(ele);
}
return this;
}
/**
*
* The architecture type.
*
*
* @param architectureTypes
* The architecture type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ArchitectureType
*/
public InstanceRequirementsWithMetadataRequest withArchitectureTypes(java.util.Collection architectureTypes) {
setArchitectureTypes(architectureTypes);
return this;
}
/**
*
* The architecture type.
*
*
* @param architectureTypes
* The architecture type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ArchitectureType
*/
public InstanceRequirementsWithMetadataRequest withArchitectureTypes(ArchitectureType... architectureTypes) {
com.amazonaws.internal.SdkInternalList architectureTypesCopy = new com.amazonaws.internal.SdkInternalList(architectureTypes.length);
for (ArchitectureType value : architectureTypes) {
architectureTypesCopy.add(value.toString());
}
if (getArchitectureTypes() == null) {
setArchitectureTypes(architectureTypesCopy);
} else {
getArchitectureTypes().addAll(architectureTypesCopy);
}
return this;
}
/**
*
* The virtualization type.
*
*
* @return The virtualization type.
* @see VirtualizationType
*/
public java.util.List getVirtualizationTypes() {
if (virtualizationTypes == null) {
virtualizationTypes = new com.amazonaws.internal.SdkInternalList();
}
return virtualizationTypes;
}
/**
*
* The virtualization type.
*
*
* @param virtualizationTypes
* The virtualization type.
* @see VirtualizationType
*/
public void setVirtualizationTypes(java.util.Collection virtualizationTypes) {
if (virtualizationTypes == null) {
this.virtualizationTypes = null;
return;
}
this.virtualizationTypes = new com.amazonaws.internal.SdkInternalList(virtualizationTypes);
}
/**
*
* The virtualization type.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setVirtualizationTypes(java.util.Collection)} or {@link #withVirtualizationTypes(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param virtualizationTypes
* The virtualization type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VirtualizationType
*/
public InstanceRequirementsWithMetadataRequest withVirtualizationTypes(String... virtualizationTypes) {
if (this.virtualizationTypes == null) {
setVirtualizationTypes(new com.amazonaws.internal.SdkInternalList(virtualizationTypes.length));
}
for (String ele : virtualizationTypes) {
this.virtualizationTypes.add(ele);
}
return this;
}
/**
*
* The virtualization type.
*
*
* @param virtualizationTypes
* The virtualization type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VirtualizationType
*/
public InstanceRequirementsWithMetadataRequest withVirtualizationTypes(java.util.Collection virtualizationTypes) {
setVirtualizationTypes(virtualizationTypes);
return this;
}
/**
*
* The virtualization type.
*
*
* @param virtualizationTypes
* The virtualization type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VirtualizationType
*/
public InstanceRequirementsWithMetadataRequest withVirtualizationTypes(VirtualizationType... virtualizationTypes) {
com.amazonaws.internal.SdkInternalList virtualizationTypesCopy = new com.amazonaws.internal.SdkInternalList(virtualizationTypes.length);
for (VirtualizationType value : virtualizationTypes) {
virtualizationTypesCopy.add(value.toString());
}
if (getVirtualizationTypes() == null) {
setVirtualizationTypes(virtualizationTypesCopy);
} else {
getVirtualizationTypes().addAll(virtualizationTypesCopy);
}
return this;
}
/**
*
* The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance
* types with those attributes.
*
*
* @param instanceRequirements
* The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify
* instance types with those attributes.
*/
public void setInstanceRequirements(InstanceRequirementsRequest instanceRequirements) {
this.instanceRequirements = instanceRequirements;
}
/**
*
* The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance
* types with those attributes.
*
*
* @return The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify
* instance types with those attributes.
*/
public InstanceRequirementsRequest getInstanceRequirements() {
return this.instanceRequirements;
}
/**
*
* The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance
* types with those attributes.
*
*
* @param instanceRequirements
* The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify
* instance types with those attributes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceRequirementsWithMetadataRequest withInstanceRequirements(InstanceRequirementsRequest instanceRequirements) {
setInstanceRequirements(instanceRequirements);
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 (getArchitectureTypes() != null)
sb.append("ArchitectureTypes: ").append(getArchitectureTypes()).append(",");
if (getVirtualizationTypes() != null)
sb.append("VirtualizationTypes: ").append(getVirtualizationTypes()).append(",");
if (getInstanceRequirements() != null)
sb.append("InstanceRequirements: ").append(getInstanceRequirements());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof InstanceRequirementsWithMetadataRequest == false)
return false;
InstanceRequirementsWithMetadataRequest other = (InstanceRequirementsWithMetadataRequest) obj;
if (other.getArchitectureTypes() == null ^ this.getArchitectureTypes() == null)
return false;
if (other.getArchitectureTypes() != null && other.getArchitectureTypes().equals(this.getArchitectureTypes()) == false)
return false;
if (other.getVirtualizationTypes() == null ^ this.getVirtualizationTypes() == null)
return false;
if (other.getVirtualizationTypes() != null && other.getVirtualizationTypes().equals(this.getVirtualizationTypes()) == false)
return false;
if (other.getInstanceRequirements() == null ^ this.getInstanceRequirements() == null)
return false;
if (other.getInstanceRequirements() != null && other.getInstanceRequirements().equals(this.getInstanceRequirements()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArchitectureTypes() == null) ? 0 : getArchitectureTypes().hashCode());
hashCode = prime * hashCode + ((getVirtualizationTypes() == null) ? 0 : getVirtualizationTypes().hashCode());
hashCode = prime * hashCode + ((getInstanceRequirements() == null) ? 0 : getInstanceRequirements().hashCode());
return hashCode;
}
@Override
public InstanceRequirementsWithMetadataRequest clone() {
try {
return (InstanceRequirementsWithMetadataRequest) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}