com.amazonaws.services.batch.model.NodePropertyOverride Maven / Gradle / Ivy
Show all versions of aws-java-sdk-batch 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.batch.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The object that represents any node overrides to a job definition that's used in a SubmitJob API operation.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class NodePropertyOverride implements Serializable, Cloneable, StructuredPojo {
/**
*
* The range of nodes, using node index values, that's used to override. A range of 0:3
indicates nodes
* with index values of 0
through 3
. If the starting range value is omitted (
* :n
), then 0
is used to start the range. If the ending range value is omitted (
* n:
), then the highest possible node index is used to end the range.
*
*/
private String targetNodes;
/**
*
* The overrides that are sent to a node range.
*
*/
private ContainerOverrides containerOverrides;
/**
*
* An object that contains the properties that you want to replace for the existing Amazon ECS resources of a job.
*
*/
private EcsPropertiesOverride ecsPropertiesOverride;
/**
*
* An object that contains the instance types that you want to replace for the existing resources of a job.
*
*/
private java.util.List instanceTypes;
/**
*
* An object that contains the properties that you want to replace for the existing Amazon EKS resources of a job.
*
*/
private EksPropertiesOverride eksPropertiesOverride;
/**
*
* The range of nodes, using node index values, that's used to override. A range of 0:3
indicates nodes
* with index values of 0
through 3
. If the starting range value is omitted (
* :n
), then 0
is used to start the range. If the ending range value is omitted (
* n:
), then the highest possible node index is used to end the range.
*
*
* @param targetNodes
* The range of nodes, using node index values, that's used to override. A range of 0:3
* indicates nodes with index values of 0
through 3
. If the starting range value is
* omitted (:n
), then 0
is used to start the range. If the ending range value is
* omitted (n:
), then the highest possible node index is used to end the range.
*/
public void setTargetNodes(String targetNodes) {
this.targetNodes = targetNodes;
}
/**
*
* The range of nodes, using node index values, that's used to override. A range of 0:3
indicates nodes
* with index values of 0
through 3
. If the starting range value is omitted (
* :n
), then 0
is used to start the range. If the ending range value is omitted (
* n:
), then the highest possible node index is used to end the range.
*
*
* @return The range of nodes, using node index values, that's used to override. A range of 0:3
* indicates nodes with index values of 0
through 3
. If the starting range value
* is omitted (:n
), then 0
is used to start the range. If the ending range value
* is omitted (n:
), then the highest possible node index is used to end the range.
*/
public String getTargetNodes() {
return this.targetNodes;
}
/**
*
* The range of nodes, using node index values, that's used to override. A range of 0:3
indicates nodes
* with index values of 0
through 3
. If the starting range value is omitted (
* :n
), then 0
is used to start the range. If the ending range value is omitted (
* n:
), then the highest possible node index is used to end the range.
*
*
* @param targetNodes
* The range of nodes, using node index values, that's used to override. A range of 0:3
* indicates nodes with index values of 0
through 3
. If the starting range value is
* omitted (:n
), then 0
is used to start the range. If the ending range value is
* omitted (n:
), then the highest possible node index is used to end the range.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NodePropertyOverride withTargetNodes(String targetNodes) {
setTargetNodes(targetNodes);
return this;
}
/**
*
* The overrides that are sent to a node range.
*
*
* @param containerOverrides
* The overrides that are sent to a node range.
*/
public void setContainerOverrides(ContainerOverrides containerOverrides) {
this.containerOverrides = containerOverrides;
}
/**
*
* The overrides that are sent to a node range.
*
*
* @return The overrides that are sent to a node range.
*/
public ContainerOverrides getContainerOverrides() {
return this.containerOverrides;
}
/**
*
* The overrides that are sent to a node range.
*
*
* @param containerOverrides
* The overrides that are sent to a node range.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NodePropertyOverride withContainerOverrides(ContainerOverrides containerOverrides) {
setContainerOverrides(containerOverrides);
return this;
}
/**
*
* An object that contains the properties that you want to replace for the existing Amazon ECS resources of a job.
*
*
* @param ecsPropertiesOverride
* An object that contains the properties that you want to replace for the existing Amazon ECS resources of a
* job.
*/
public void setEcsPropertiesOverride(EcsPropertiesOverride ecsPropertiesOverride) {
this.ecsPropertiesOverride = ecsPropertiesOverride;
}
/**
*
* An object that contains the properties that you want to replace for the existing Amazon ECS resources of a job.
*
*
* @return An object that contains the properties that you want to replace for the existing Amazon ECS resources of
* a job.
*/
public EcsPropertiesOverride getEcsPropertiesOverride() {
return this.ecsPropertiesOverride;
}
/**
*
* An object that contains the properties that you want to replace for the existing Amazon ECS resources of a job.
*
*
* @param ecsPropertiesOverride
* An object that contains the properties that you want to replace for the existing Amazon ECS resources of a
* job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NodePropertyOverride withEcsPropertiesOverride(EcsPropertiesOverride ecsPropertiesOverride) {
setEcsPropertiesOverride(ecsPropertiesOverride);
return this;
}
/**
*
* An object that contains the instance types that you want to replace for the existing resources of a job.
*
*
* @return An object that contains the instance types that you want to replace for the existing resources of a job.
*/
public java.util.List getInstanceTypes() {
return instanceTypes;
}
/**
*
* An object that contains the instance types that you want to replace for the existing resources of a job.
*
*
* @param instanceTypes
* An object that contains the instance types that you want to replace for the existing resources of a job.
*/
public void setInstanceTypes(java.util.Collection instanceTypes) {
if (instanceTypes == null) {
this.instanceTypes = null;
return;
}
this.instanceTypes = new java.util.ArrayList(instanceTypes);
}
/**
*
* An object that contains the instance types that you want to replace for the existing resources of a job.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setInstanceTypes(java.util.Collection)} or {@link #withInstanceTypes(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param instanceTypes
* An object that contains the instance types that you want to replace for the existing resources of a job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NodePropertyOverride withInstanceTypes(String... instanceTypes) {
if (this.instanceTypes == null) {
setInstanceTypes(new java.util.ArrayList(instanceTypes.length));
}
for (String ele : instanceTypes) {
this.instanceTypes.add(ele);
}
return this;
}
/**
*
* An object that contains the instance types that you want to replace for the existing resources of a job.
*
*
* @param instanceTypes
* An object that contains the instance types that you want to replace for the existing resources of a job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NodePropertyOverride withInstanceTypes(java.util.Collection instanceTypes) {
setInstanceTypes(instanceTypes);
return this;
}
/**
*
* An object that contains the properties that you want to replace for the existing Amazon EKS resources of a job.
*
*
* @param eksPropertiesOverride
* An object that contains the properties that you want to replace for the existing Amazon EKS resources of a
* job.
*/
public void setEksPropertiesOverride(EksPropertiesOverride eksPropertiesOverride) {
this.eksPropertiesOverride = eksPropertiesOverride;
}
/**
*
* An object that contains the properties that you want to replace for the existing Amazon EKS resources of a job.
*
*
* @return An object that contains the properties that you want to replace for the existing Amazon EKS resources of
* a job.
*/
public EksPropertiesOverride getEksPropertiesOverride() {
return this.eksPropertiesOverride;
}
/**
*
* An object that contains the properties that you want to replace for the existing Amazon EKS resources of a job.
*
*
* @param eksPropertiesOverride
* An object that contains the properties that you want to replace for the existing Amazon EKS resources of a
* job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NodePropertyOverride withEksPropertiesOverride(EksPropertiesOverride eksPropertiesOverride) {
setEksPropertiesOverride(eksPropertiesOverride);
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 (getTargetNodes() != null)
sb.append("TargetNodes: ").append(getTargetNodes()).append(",");
if (getContainerOverrides() != null)
sb.append("ContainerOverrides: ").append(getContainerOverrides()).append(",");
if (getEcsPropertiesOverride() != null)
sb.append("EcsPropertiesOverride: ").append(getEcsPropertiesOverride()).append(",");
if (getInstanceTypes() != null)
sb.append("InstanceTypes: ").append(getInstanceTypes()).append(",");
if (getEksPropertiesOverride() != null)
sb.append("EksPropertiesOverride: ").append(getEksPropertiesOverride());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof NodePropertyOverride == false)
return false;
NodePropertyOverride other = (NodePropertyOverride) obj;
if (other.getTargetNodes() == null ^ this.getTargetNodes() == null)
return false;
if (other.getTargetNodes() != null && other.getTargetNodes().equals(this.getTargetNodes()) == false)
return false;
if (other.getContainerOverrides() == null ^ this.getContainerOverrides() == null)
return false;
if (other.getContainerOverrides() != null && other.getContainerOverrides().equals(this.getContainerOverrides()) == false)
return false;
if (other.getEcsPropertiesOverride() == null ^ this.getEcsPropertiesOverride() == null)
return false;
if (other.getEcsPropertiesOverride() != null && other.getEcsPropertiesOverride().equals(this.getEcsPropertiesOverride()) == false)
return false;
if (other.getInstanceTypes() == null ^ this.getInstanceTypes() == null)
return false;
if (other.getInstanceTypes() != null && other.getInstanceTypes().equals(this.getInstanceTypes()) == false)
return false;
if (other.getEksPropertiesOverride() == null ^ this.getEksPropertiesOverride() == null)
return false;
if (other.getEksPropertiesOverride() != null && other.getEksPropertiesOverride().equals(this.getEksPropertiesOverride()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTargetNodes() == null) ? 0 : getTargetNodes().hashCode());
hashCode = prime * hashCode + ((getContainerOverrides() == null) ? 0 : getContainerOverrides().hashCode());
hashCode = prime * hashCode + ((getEcsPropertiesOverride() == null) ? 0 : getEcsPropertiesOverride().hashCode());
hashCode = prime * hashCode + ((getInstanceTypes() == null) ? 0 : getInstanceTypes().hashCode());
hashCode = prime * hashCode + ((getEksPropertiesOverride() == null) ? 0 : getEksPropertiesOverride().hashCode());
return hashCode;
}
@Override
public NodePropertyOverride clone() {
try {
return (NodePropertyOverride) 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.batch.model.transform.NodePropertyOverrideMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}