All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.ec2.model.ImageAttribute Maven / Gradle / Ivy

Go to download

The AWS SDK for Java with support for OSGi. The AWS SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).

There is a newer version: 1.11.60
Show newest version
/*
 * Copyright 2011-2016 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;

/**
 * 

* Describes an image attribute. *

*/ public class ImageAttribute implements Serializable, Cloneable { /** *

* The ID of the AMI. *

*/ private String imageId; /** *

* One or more launch permissions. *

*/ private com.amazonaws.internal.SdkInternalList launchPermissions; /** *

* One or more product codes. *

*/ private com.amazonaws.internal.SdkInternalList productCodes; /** *

* The kernel ID. *

*/ private String kernelId; /** *

* The RAM disk ID. *

*/ private String ramdiskId; /** *

* A description for the AMI. *

*/ private String description; /** *

* Indicates whether enhanced networking with the Intel 82599 Virtual * Function interface is enabled. *

*/ private String sriovNetSupport; /** *

* One or more block device mapping entries. *

*/ private com.amazonaws.internal.SdkInternalList blockDeviceMappings; /** *

* The ID of the AMI. *

* * @param imageId * The ID of the AMI. */ public void setImageId(String imageId) { this.imageId = imageId; } /** *

* The ID of the AMI. *

* * @return The ID of the AMI. */ public String getImageId() { return this.imageId; } /** *

* The ID of the AMI. *

* * @param imageId * The ID of the AMI. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withImageId(String imageId) { setImageId(imageId); return this; } /** *

* One or more launch permissions. *

* * @return One or more launch permissions. */ public java.util.List getLaunchPermissions() { if (launchPermissions == null) { launchPermissions = new com.amazonaws.internal.SdkInternalList(); } return launchPermissions; } /** *

* One or more launch permissions. *

* * @param launchPermissions * One or more launch permissions. */ public void setLaunchPermissions( java.util.Collection launchPermissions) { if (launchPermissions == null) { this.launchPermissions = null; return; } this.launchPermissions = new com.amazonaws.internal.SdkInternalList( launchPermissions); } /** *

* One or more launch permissions. *

*

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setLaunchPermissions(java.util.Collection)} or * {@link #withLaunchPermissions(java.util.Collection)} if you want to * override the existing values. *

* * @param launchPermissions * One or more launch permissions. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withLaunchPermissions( LaunchPermission... launchPermissions) { if (this.launchPermissions == null) { setLaunchPermissions(new com.amazonaws.internal.SdkInternalList( launchPermissions.length)); } for (LaunchPermission ele : launchPermissions) { this.launchPermissions.add(ele); } return this; } /** *

* One or more launch permissions. *

* * @param launchPermissions * One or more launch permissions. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withLaunchPermissions( java.util.Collection launchPermissions) { setLaunchPermissions(launchPermissions); return this; } /** *

* One or more product codes. *

* * @return One or more product codes. */ public java.util.List getProductCodes() { if (productCodes == null) { productCodes = new com.amazonaws.internal.SdkInternalList(); } return productCodes; } /** *

* One or more product codes. *

* * @param productCodes * One or more product codes. */ public void setProductCodes(java.util.Collection productCodes) { if (productCodes == null) { this.productCodes = null; return; } this.productCodes = new com.amazonaws.internal.SdkInternalList( productCodes); } /** *

* One or more product codes. *

*

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setProductCodes(java.util.Collection)} or * {@link #withProductCodes(java.util.Collection)} if you want to override * the existing values. *

* * @param productCodes * One or more product codes. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withProductCodes(ProductCode... productCodes) { if (this.productCodes == null) { setProductCodes(new com.amazonaws.internal.SdkInternalList( productCodes.length)); } for (ProductCode ele : productCodes) { this.productCodes.add(ele); } return this; } /** *

* One or more product codes. *

* * @param productCodes * One or more product codes. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withProductCodes( java.util.Collection productCodes) { setProductCodes(productCodes); return this; } /** *

* The kernel ID. *

* * @param kernelId * The kernel ID. */ public void setKernelId(String kernelId) { this.kernelId = kernelId; } /** *

* The kernel ID. *

* * @return The kernel ID. */ public String getKernelId() { return this.kernelId; } /** *

* The kernel ID. *

* * @param kernelId * The kernel ID. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withKernelId(String kernelId) { setKernelId(kernelId); return this; } /** *

* The RAM disk ID. *

* * @param ramdiskId * The RAM disk ID. */ public void setRamdiskId(String ramdiskId) { this.ramdiskId = ramdiskId; } /** *

* The RAM disk ID. *

* * @return The RAM disk ID. */ public String getRamdiskId() { return this.ramdiskId; } /** *

* The RAM disk ID. *

* * @param ramdiskId * The RAM disk ID. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withRamdiskId(String ramdiskId) { setRamdiskId(ramdiskId); return this; } /** *

* A description for the AMI. *

* * @param description * A description for the AMI. */ public void setDescription(String description) { this.description = description; } /** *

* A description for the AMI. *

* * @return A description for the AMI. */ public String getDescription() { return this.description; } /** *

* A description for the AMI. *

* * @param description * A description for the AMI. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withDescription(String description) { setDescription(description); return this; } /** *

* Indicates whether enhanced networking with the Intel 82599 Virtual * Function interface is enabled. *

* * @param sriovNetSupport * Indicates whether enhanced networking with the Intel 82599 Virtual * Function interface is enabled. */ public void setSriovNetSupport(String sriovNetSupport) { this.sriovNetSupport = sriovNetSupport; } /** *

* Indicates whether enhanced networking with the Intel 82599 Virtual * Function interface is enabled. *

* * @return Indicates whether enhanced networking with the Intel 82599 * Virtual Function interface is enabled. */ public String getSriovNetSupport() { return this.sriovNetSupport; } /** *

* Indicates whether enhanced networking with the Intel 82599 Virtual * Function interface is enabled. *

* * @param sriovNetSupport * Indicates whether enhanced networking with the Intel 82599 Virtual * Function interface is enabled. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withSriovNetSupport(String sriovNetSupport) { setSriovNetSupport(sriovNetSupport); return this; } /** *

* One or more block device mapping entries. *

* * @return One or more block device mapping entries. */ public java.util.List getBlockDeviceMappings() { if (blockDeviceMappings == null) { blockDeviceMappings = new com.amazonaws.internal.SdkInternalList(); } return blockDeviceMappings; } /** *

* One or more block device mapping entries. *

* * @param blockDeviceMappings * One or more block device mapping entries. */ public void setBlockDeviceMappings( java.util.Collection blockDeviceMappings) { if (blockDeviceMappings == null) { this.blockDeviceMappings = null; return; } this.blockDeviceMappings = new com.amazonaws.internal.SdkInternalList( blockDeviceMappings); } /** *

* One or more block device mapping entries. *

*

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setBlockDeviceMappings(java.util.Collection)} or * {@link #withBlockDeviceMappings(java.util.Collection)} if you want to * override the existing values. *

* * @param blockDeviceMappings * One or more block device mapping entries. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withBlockDeviceMappings( BlockDeviceMapping... blockDeviceMappings) { if (this.blockDeviceMappings == null) { setBlockDeviceMappings(new com.amazonaws.internal.SdkInternalList( blockDeviceMappings.length)); } for (BlockDeviceMapping ele : blockDeviceMappings) { this.blockDeviceMappings.add(ele); } return this; } /** *

* One or more block device mapping entries. *

* * @param blockDeviceMappings * One or more block device mapping entries. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImageAttribute withBlockDeviceMappings( java.util.Collection blockDeviceMappings) { setBlockDeviceMappings(blockDeviceMappings); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getImageId() != null) sb.append("ImageId: " + getImageId() + ","); if (getLaunchPermissions() != null) sb.append("LaunchPermissions: " + getLaunchPermissions() + ","); if (getProductCodes() != null) sb.append("ProductCodes: " + getProductCodes() + ","); if (getKernelId() != null) sb.append("KernelId: " + getKernelId() + ","); if (getRamdiskId() != null) sb.append("RamdiskId: " + getRamdiskId() + ","); if (getDescription() != null) sb.append("Description: " + getDescription() + ","); if (getSriovNetSupport() != null) sb.append("SriovNetSupport: " + getSriovNetSupport() + ","); if (getBlockDeviceMappings() != null) sb.append("BlockDeviceMappings: " + getBlockDeviceMappings()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ImageAttribute == false) return false; ImageAttribute other = (ImageAttribute) obj; if (other.getImageId() == null ^ this.getImageId() == null) return false; if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false) return false; if (other.getLaunchPermissions() == null ^ this.getLaunchPermissions() == null) return false; if (other.getLaunchPermissions() != null && other.getLaunchPermissions().equals( this.getLaunchPermissions()) == false) return false; if (other.getProductCodes() == null ^ this.getProductCodes() == null) return false; if (other.getProductCodes() != null && other.getProductCodes().equals(this.getProductCodes()) == false) return false; if (other.getKernelId() == null ^ this.getKernelId() == null) return false; if (other.getKernelId() != null && other.getKernelId().equals(this.getKernelId()) == false) return false; if (other.getRamdiskId() == null ^ this.getRamdiskId() == null) return false; if (other.getRamdiskId() != null && other.getRamdiskId().equals(this.getRamdiskId()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getSriovNetSupport() == null ^ this.getSriovNetSupport() == null) return false; if (other.getSriovNetSupport() != null && other.getSriovNetSupport().equals(this.getSriovNetSupport()) == false) return false; if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == null) return false; if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals( this.getBlockDeviceMappings()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); hashCode = prime * hashCode + ((getLaunchPermissions() == null) ? 0 : getLaunchPermissions().hashCode()); hashCode = prime * hashCode + ((getProductCodes() == null) ? 0 : getProductCodes() .hashCode()); hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode()); hashCode = prime * hashCode + ((getRamdiskId() == null) ? 0 : getRamdiskId().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getSriovNetSupport() == null) ? 0 : getSriovNetSupport() .hashCode()); hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); return hashCode; } @Override public ImageAttribute clone() { try { return (ImageAttribute) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy