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

com.amazonaws.services.elasticmapreduce.model.Instance Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EMR module holds the client classes that are used for communicating with Amazon Elastic MapReduce Service

There is a newer version: 1.11.85
Show newest version
/*
 * Copyright 2010-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.elasticmapreduce.model;

import java.io.Serializable;

/**
 * 

* Represents an EC2 instance provisioned as part of cluster. *

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

* The unique identifier for the instance in Amazon EMR. *

*/ private String id; /** *

* The unique identifier of the instance in Amazon EC2. *

*/ private String ec2InstanceId; /** *

* The public DNS name of the instance. *

*/ private String publicDnsName; /** *

* The public IP address of the instance. *

*/ private String publicIpAddress; /** *

* The private DNS name of the instance. *

*/ private String privateDnsName; /** *

* The private IP address of the instance. *

*/ private String privateIpAddress; /** *

* The current status of the instance. *

*/ private InstanceStatus status; /** *

* The identifier of the instance group to which this instance belongs. *

*/ private String instanceGroupId; /** *

* The list of EBS volumes that are attached to this instance. *

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

* The unique identifier for the instance in Amazon EMR. *

* * @param id * The unique identifier for the instance in Amazon EMR. */ public void setId(String id) { this.id = id; } /** *

* The unique identifier for the instance in Amazon EMR. *

* * @return The unique identifier for the instance in Amazon EMR. */ public String getId() { return this.id; } /** *

* The unique identifier for the instance in Amazon EMR. *

* * @param id * The unique identifier for the instance in Amazon EMR. * @return Returns a reference to this object so that method calls can be * chained together. */ public Instance withId(String id) { setId(id); return this; } /** *

* The unique identifier of the instance in Amazon EC2. *

* * @param ec2InstanceId * The unique identifier of the instance in Amazon EC2. */ public void setEc2InstanceId(String ec2InstanceId) { this.ec2InstanceId = ec2InstanceId; } /** *

* The unique identifier of the instance in Amazon EC2. *

* * @return The unique identifier of the instance in Amazon EC2. */ public String getEc2InstanceId() { return this.ec2InstanceId; } /** *

* The unique identifier of the instance in Amazon EC2. *

* * @param ec2InstanceId * The unique identifier of the instance in Amazon EC2. * @return Returns a reference to this object so that method calls can be * chained together. */ public Instance withEc2InstanceId(String ec2InstanceId) { setEc2InstanceId(ec2InstanceId); return this; } /** *

* The public DNS name of the instance. *

* * @param publicDnsName * The public DNS name of the instance. */ public void setPublicDnsName(String publicDnsName) { this.publicDnsName = publicDnsName; } /** *

* The public DNS name of the instance. *

* * @return The public DNS name of the instance. */ public String getPublicDnsName() { return this.publicDnsName; } /** *

* The public DNS name of the instance. *

* * @param publicDnsName * The public DNS name of the instance. * @return Returns a reference to this object so that method calls can be * chained together. */ public Instance withPublicDnsName(String publicDnsName) { setPublicDnsName(publicDnsName); return this; } /** *

* The public IP address of the instance. *

* * @param publicIpAddress * The public IP address of the instance. */ public void setPublicIpAddress(String publicIpAddress) { this.publicIpAddress = publicIpAddress; } /** *

* The public IP address of the instance. *

* * @return The public IP address of the instance. */ public String getPublicIpAddress() { return this.publicIpAddress; } /** *

* The public IP address of the instance. *

* * @param publicIpAddress * The public IP address of the instance. * @return Returns a reference to this object so that method calls can be * chained together. */ public Instance withPublicIpAddress(String publicIpAddress) { setPublicIpAddress(publicIpAddress); return this; } /** *

* The private DNS name of the instance. *

* * @param privateDnsName * The private DNS name of the instance. */ public void setPrivateDnsName(String privateDnsName) { this.privateDnsName = privateDnsName; } /** *

* The private DNS name of the instance. *

* * @return The private DNS name of the instance. */ public String getPrivateDnsName() { return this.privateDnsName; } /** *

* The private DNS name of the instance. *

* * @param privateDnsName * The private DNS name of the instance. * @return Returns a reference to this object so that method calls can be * chained together. */ public Instance withPrivateDnsName(String privateDnsName) { setPrivateDnsName(privateDnsName); return this; } /** *

* The private IP address of the instance. *

* * @param privateIpAddress * The private IP address of the instance. */ public void setPrivateIpAddress(String privateIpAddress) { this.privateIpAddress = privateIpAddress; } /** *

* The private IP address of the instance. *

* * @return The private IP address of the instance. */ public String getPrivateIpAddress() { return this.privateIpAddress; } /** *

* The private IP address of the instance. *

* * @param privateIpAddress * The private IP address of the instance. * @return Returns a reference to this object so that method calls can be * chained together. */ public Instance withPrivateIpAddress(String privateIpAddress) { setPrivateIpAddress(privateIpAddress); return this; } /** *

* The current status of the instance. *

* * @param status * The current status of the instance. */ public void setStatus(InstanceStatus status) { this.status = status; } /** *

* The current status of the instance. *

* * @return The current status of the instance. */ public InstanceStatus getStatus() { return this.status; } /** *

* The current status of the instance. *

* * @param status * The current status of the instance. * @return Returns a reference to this object so that method calls can be * chained together. */ public Instance withStatus(InstanceStatus status) { setStatus(status); return this; } /** *

* The identifier of the instance group to which this instance belongs. *

* * @param instanceGroupId * The identifier of the instance group to which this instance * belongs. */ public void setInstanceGroupId(String instanceGroupId) { this.instanceGroupId = instanceGroupId; } /** *

* The identifier of the instance group to which this instance belongs. *

* * @return The identifier of the instance group to which this instance * belongs. */ public String getInstanceGroupId() { return this.instanceGroupId; } /** *

* The identifier of the instance group to which this instance belongs. *

* * @param instanceGroupId * The identifier of the instance group to which this instance * belongs. * @return Returns a reference to this object so that method calls can be * chained together. */ public Instance withInstanceGroupId(String instanceGroupId) { setInstanceGroupId(instanceGroupId); return this; } /** *

* The list of EBS volumes that are attached to this instance. *

* * @return The list of EBS volumes that are attached to this instance. */ public java.util.List getEbsVolumes() { if (ebsVolumes == null) { ebsVolumes = new com.amazonaws.internal.SdkInternalList(); } return ebsVolumes; } /** *

* The list of EBS volumes that are attached to this instance. *

* * @param ebsVolumes * The list of EBS volumes that are attached to this instance. */ public void setEbsVolumes(java.util.Collection ebsVolumes) { if (ebsVolumes == null) { this.ebsVolumes = null; return; } this.ebsVolumes = new com.amazonaws.internal.SdkInternalList( ebsVolumes); } /** *

* The list of EBS volumes that are attached to this instance. *

*

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

* * @param ebsVolumes * The list of EBS volumes that are attached to this instance. * @return Returns a reference to this object so that method calls can be * chained together. */ public Instance withEbsVolumes(EbsVolume... ebsVolumes) { if (this.ebsVolumes == null) { setEbsVolumes(new com.amazonaws.internal.SdkInternalList( ebsVolumes.length)); } for (EbsVolume ele : ebsVolumes) { this.ebsVolumes.add(ele); } return this; } /** *

* The list of EBS volumes that are attached to this instance. *

* * @param ebsVolumes * The list of EBS volumes that are attached to this instance. * @return Returns a reference to this object so that method calls can be * chained together. */ public Instance withEbsVolumes(java.util.Collection ebsVolumes) { setEbsVolumes(ebsVolumes); 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 (getId() != null) sb.append("Id: " + getId() + ","); if (getEc2InstanceId() != null) sb.append("Ec2InstanceId: " + getEc2InstanceId() + ","); if (getPublicDnsName() != null) sb.append("PublicDnsName: " + getPublicDnsName() + ","); if (getPublicIpAddress() != null) sb.append("PublicIpAddress: " + getPublicIpAddress() + ","); if (getPrivateDnsName() != null) sb.append("PrivateDnsName: " + getPrivateDnsName() + ","); if (getPrivateIpAddress() != null) sb.append("PrivateIpAddress: " + getPrivateIpAddress() + ","); if (getStatus() != null) sb.append("Status: " + getStatus() + ","); if (getInstanceGroupId() != null) sb.append("InstanceGroupId: " + getInstanceGroupId() + ","); if (getEbsVolumes() != null) sb.append("EbsVolumes: " + getEbsVolumes()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Instance == false) return false; Instance other = (Instance) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getEc2InstanceId() == null ^ this.getEc2InstanceId() == null) return false; if (other.getEc2InstanceId() != null && other.getEc2InstanceId().equals(this.getEc2InstanceId()) == false) return false; if (other.getPublicDnsName() == null ^ this.getPublicDnsName() == null) return false; if (other.getPublicDnsName() != null && other.getPublicDnsName().equals(this.getPublicDnsName()) == false) return false; if (other.getPublicIpAddress() == null ^ this.getPublicIpAddress() == null) return false; if (other.getPublicIpAddress() != null && other.getPublicIpAddress().equals(this.getPublicIpAddress()) == false) return false; if (other.getPrivateDnsName() == null ^ this.getPrivateDnsName() == null) return false; if (other.getPrivateDnsName() != null && other.getPrivateDnsName().equals(this.getPrivateDnsName()) == 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.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getInstanceGroupId() == null ^ this.getInstanceGroupId() == null) return false; if (other.getInstanceGroupId() != null && other.getInstanceGroupId().equals(this.getInstanceGroupId()) == false) return false; if (other.getEbsVolumes() == null ^ this.getEbsVolumes() == null) return false; if (other.getEbsVolumes() != null && other.getEbsVolumes().equals(this.getEbsVolumes()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getEc2InstanceId() == null) ? 0 : getEc2InstanceId() .hashCode()); hashCode = prime * hashCode + ((getPublicDnsName() == null) ? 0 : getPublicDnsName() .hashCode()); hashCode = prime * hashCode + ((getPublicIpAddress() == null) ? 0 : getPublicIpAddress() .hashCode()); hashCode = prime * hashCode + ((getPrivateDnsName() == null) ? 0 : getPrivateDnsName() .hashCode()); hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress() .hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getInstanceGroupId() == null) ? 0 : getInstanceGroupId() .hashCode()); hashCode = prime * hashCode + ((getEbsVolumes() == null) ? 0 : getEbsVolumes().hashCode()); return hashCode; } @Override public Instance clone() { try { return (Instance) 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