com.amazonaws.services.elasticmapreduce.model.InstanceFleetModifyConfig Maven / Gradle / Ivy
Show all versions of aws-java-sdk-emr Show documentation
/*
* Copyright 2017-2022 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;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Configuration parameters for an instance fleet modification request.
*
*
*
* The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
*
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class InstanceFleetModifyConfig implements Serializable, Cloneable, StructuredPojo {
/**
*
* A unique identifier for the instance fleet.
*
*/
private String instanceFleetId;
/**
*
* The target capacity of On-Demand units for the instance fleet. For more information see
* InstanceFleetConfig$TargetOnDemandCapacity.
*
*/
private Integer targetOnDemandCapacity;
/**
*
* The target capacity of Spot units for the instance fleet. For more information, see
* InstanceFleetConfig$TargetSpotCapacity.
*
*/
private Integer targetSpotCapacity;
/**
*
* A unique identifier for the instance fleet.
*
*
* @param instanceFleetId
* A unique identifier for the instance fleet.
*/
public void setInstanceFleetId(String instanceFleetId) {
this.instanceFleetId = instanceFleetId;
}
/**
*
* A unique identifier for the instance fleet.
*
*
* @return A unique identifier for the instance fleet.
*/
public String getInstanceFleetId() {
return this.instanceFleetId;
}
/**
*
* A unique identifier for the instance fleet.
*
*
* @param instanceFleetId
* A unique identifier for the instance fleet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceFleetModifyConfig withInstanceFleetId(String instanceFleetId) {
setInstanceFleetId(instanceFleetId);
return this;
}
/**
*
* The target capacity of On-Demand units for the instance fleet. For more information see
* InstanceFleetConfig$TargetOnDemandCapacity.
*
*
* @param targetOnDemandCapacity
* The target capacity of On-Demand units for the instance fleet. For more information see
* InstanceFleetConfig$TargetOnDemandCapacity.
*/
public void setTargetOnDemandCapacity(Integer targetOnDemandCapacity) {
this.targetOnDemandCapacity = targetOnDemandCapacity;
}
/**
*
* The target capacity of On-Demand units for the instance fleet. For more information see
* InstanceFleetConfig$TargetOnDemandCapacity.
*
*
* @return The target capacity of On-Demand units for the instance fleet. For more information see
* InstanceFleetConfig$TargetOnDemandCapacity.
*/
public Integer getTargetOnDemandCapacity() {
return this.targetOnDemandCapacity;
}
/**
*
* The target capacity of On-Demand units for the instance fleet. For more information see
* InstanceFleetConfig$TargetOnDemandCapacity.
*
*
* @param targetOnDemandCapacity
* The target capacity of On-Demand units for the instance fleet. For more information see
* InstanceFleetConfig$TargetOnDemandCapacity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceFleetModifyConfig withTargetOnDemandCapacity(Integer targetOnDemandCapacity) {
setTargetOnDemandCapacity(targetOnDemandCapacity);
return this;
}
/**
*
* The target capacity of Spot units for the instance fleet. For more information, see
* InstanceFleetConfig$TargetSpotCapacity.
*
*
* @param targetSpotCapacity
* The target capacity of Spot units for the instance fleet. For more information, see
* InstanceFleetConfig$TargetSpotCapacity.
*/
public void setTargetSpotCapacity(Integer targetSpotCapacity) {
this.targetSpotCapacity = targetSpotCapacity;
}
/**
*
* The target capacity of Spot units for the instance fleet. For more information, see
* InstanceFleetConfig$TargetSpotCapacity.
*
*
* @return The target capacity of Spot units for the instance fleet. For more information, see
* InstanceFleetConfig$TargetSpotCapacity.
*/
public Integer getTargetSpotCapacity() {
return this.targetSpotCapacity;
}
/**
*
* The target capacity of Spot units for the instance fleet. For more information, see
* InstanceFleetConfig$TargetSpotCapacity.
*
*
* @param targetSpotCapacity
* The target capacity of Spot units for the instance fleet. For more information, see
* InstanceFleetConfig$TargetSpotCapacity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceFleetModifyConfig withTargetSpotCapacity(Integer targetSpotCapacity) {
setTargetSpotCapacity(targetSpotCapacity);
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 (getInstanceFleetId() != null)
sb.append("InstanceFleetId: ").append(getInstanceFleetId()).append(",");
if (getTargetOnDemandCapacity() != null)
sb.append("TargetOnDemandCapacity: ").append(getTargetOnDemandCapacity()).append(",");
if (getTargetSpotCapacity() != null)
sb.append("TargetSpotCapacity: ").append(getTargetSpotCapacity());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof InstanceFleetModifyConfig == false)
return false;
InstanceFleetModifyConfig other = (InstanceFleetModifyConfig) obj;
if (other.getInstanceFleetId() == null ^ this.getInstanceFleetId() == null)
return false;
if (other.getInstanceFleetId() != null && other.getInstanceFleetId().equals(this.getInstanceFleetId()) == false)
return false;
if (other.getTargetOnDemandCapacity() == null ^ this.getTargetOnDemandCapacity() == null)
return false;
if (other.getTargetOnDemandCapacity() != null && other.getTargetOnDemandCapacity().equals(this.getTargetOnDemandCapacity()) == false)
return false;
if (other.getTargetSpotCapacity() == null ^ this.getTargetSpotCapacity() == null)
return false;
if (other.getTargetSpotCapacity() != null && other.getTargetSpotCapacity().equals(this.getTargetSpotCapacity()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getInstanceFleetId() == null) ? 0 : getInstanceFleetId().hashCode());
hashCode = prime * hashCode + ((getTargetOnDemandCapacity() == null) ? 0 : getTargetOnDemandCapacity().hashCode());
hashCode = prime * hashCode + ((getTargetSpotCapacity() == null) ? 0 : getTargetSpotCapacity().hashCode());
return hashCode;
}
@Override
public InstanceFleetModifyConfig clone() {
try {
return (InstanceFleetModifyConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.elasticmapreduce.model.transform.InstanceFleetModifyConfigMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}