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

com.amazonaws.services.elasticmapreduce.model.InstanceResizePolicy 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.elasticmapreduce.model;

import java.io.Serializable;

/**
 * 

* Custom policy for requesting termination protection or termination of * specific instances when shrinking an instance group. *

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

* Specific list of instances to be terminated when shrinking an instance * group. *

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

* Specific list of instances to be protected when shrinking an instance * group. *

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

* Decommissioning timeout override for the specific list of instances to be * terminated. *

*/ private Integer instanceTerminationTimeout; /** *

* Specific list of instances to be terminated when shrinking an instance * group. *

* * @return Specific list of instances to be terminated when shrinking an * instance group. */ public java.util.List getInstancesToTerminate() { if (instancesToTerminate == null) { instancesToTerminate = new com.amazonaws.internal.SdkInternalList(); } return instancesToTerminate; } /** *

* Specific list of instances to be terminated when shrinking an instance * group. *

* * @param instancesToTerminate * Specific list of instances to be terminated when shrinking an * instance group. */ public void setInstancesToTerminate( java.util.Collection instancesToTerminate) { if (instancesToTerminate == null) { this.instancesToTerminate = null; return; } this.instancesToTerminate = new com.amazonaws.internal.SdkInternalList( instancesToTerminate); } /** *

* Specific list of instances to be terminated when shrinking an instance * group. *

*

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

* * @param instancesToTerminate * Specific list of instances to be terminated when shrinking an * instance group. * @return Returns a reference to this object so that method calls can be * chained together. */ public InstanceResizePolicy withInstancesToTerminate( String... instancesToTerminate) { if (this.instancesToTerminate == null) { setInstancesToTerminate(new com.amazonaws.internal.SdkInternalList( instancesToTerminate.length)); } for (String ele : instancesToTerminate) { this.instancesToTerminate.add(ele); } return this; } /** *

* Specific list of instances to be terminated when shrinking an instance * group. *

* * @param instancesToTerminate * Specific list of instances to be terminated when shrinking an * instance group. * @return Returns a reference to this object so that method calls can be * chained together. */ public InstanceResizePolicy withInstancesToTerminate( java.util.Collection instancesToTerminate) { setInstancesToTerminate(instancesToTerminate); return this; } /** *

* Specific list of instances to be protected when shrinking an instance * group. *

* * @return Specific list of instances to be protected when shrinking an * instance group. */ public java.util.List getInstancesToProtect() { if (instancesToProtect == null) { instancesToProtect = new com.amazonaws.internal.SdkInternalList(); } return instancesToProtect; } /** *

* Specific list of instances to be protected when shrinking an instance * group. *

* * @param instancesToProtect * Specific list of instances to be protected when shrinking an * instance group. */ public void setInstancesToProtect( java.util.Collection instancesToProtect) { if (instancesToProtect == null) { this.instancesToProtect = null; return; } this.instancesToProtect = new com.amazonaws.internal.SdkInternalList( instancesToProtect); } /** *

* Specific list of instances to be protected when shrinking an instance * group. *

*

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

* * @param instancesToProtect * Specific list of instances to be protected when shrinking an * instance group. * @return Returns a reference to this object so that method calls can be * chained together. */ public InstanceResizePolicy withInstancesToProtect( String... instancesToProtect) { if (this.instancesToProtect == null) { setInstancesToProtect(new com.amazonaws.internal.SdkInternalList( instancesToProtect.length)); } for (String ele : instancesToProtect) { this.instancesToProtect.add(ele); } return this; } /** *

* Specific list of instances to be protected when shrinking an instance * group. *

* * @param instancesToProtect * Specific list of instances to be protected when shrinking an * instance group. * @return Returns a reference to this object so that method calls can be * chained together. */ public InstanceResizePolicy withInstancesToProtect( java.util.Collection instancesToProtect) { setInstancesToProtect(instancesToProtect); return this; } /** *

* Decommissioning timeout override for the specific list of instances to be * terminated. *

* * @param instanceTerminationTimeout * Decommissioning timeout override for the specific list of * instances to be terminated. */ public void setInstanceTerminationTimeout(Integer instanceTerminationTimeout) { this.instanceTerminationTimeout = instanceTerminationTimeout; } /** *

* Decommissioning timeout override for the specific list of instances to be * terminated. *

* * @return Decommissioning timeout override for the specific list of * instances to be terminated. */ public Integer getInstanceTerminationTimeout() { return this.instanceTerminationTimeout; } /** *

* Decommissioning timeout override for the specific list of instances to be * terminated. *

* * @param instanceTerminationTimeout * Decommissioning timeout override for the specific list of * instances to be terminated. * @return Returns a reference to this object so that method calls can be * chained together. */ public InstanceResizePolicy withInstanceTerminationTimeout( Integer instanceTerminationTimeout) { setInstanceTerminationTimeout(instanceTerminationTimeout); 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 (getInstancesToTerminate() != null) sb.append("InstancesToTerminate: " + getInstancesToTerminate() + ","); if (getInstancesToProtect() != null) sb.append("InstancesToProtect: " + getInstancesToProtect() + ","); if (getInstanceTerminationTimeout() != null) sb.append("InstanceTerminationTimeout: " + getInstanceTerminationTimeout()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InstanceResizePolicy == false) return false; InstanceResizePolicy other = (InstanceResizePolicy) obj; if (other.getInstancesToTerminate() == null ^ this.getInstancesToTerminate() == null) return false; if (other.getInstancesToTerminate() != null && other.getInstancesToTerminate().equals( this.getInstancesToTerminate()) == false) return false; if (other.getInstancesToProtect() == null ^ this.getInstancesToProtect() == null) return false; if (other.getInstancesToProtect() != null && other.getInstancesToProtect().equals( this.getInstancesToProtect()) == false) return false; if (other.getInstanceTerminationTimeout() == null ^ this.getInstanceTerminationTimeout() == null) return false; if (other.getInstanceTerminationTimeout() != null && other.getInstanceTerminationTimeout().equals( this.getInstanceTerminationTimeout()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInstancesToTerminate() == null) ? 0 : getInstancesToTerminate().hashCode()); hashCode = prime * hashCode + ((getInstancesToProtect() == null) ? 0 : getInstancesToProtect().hashCode()); hashCode = prime * hashCode + ((getInstanceTerminationTimeout() == null) ? 0 : getInstanceTerminationTimeout().hashCode()); return hashCode; } @Override public InstanceResizePolicy clone() { try { return (InstanceResizePolicy) 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