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

com.amazonaws.services.batch.model.ContainerDetail Maven / Gradle / Ivy

/*
 * Copyright 2012-2017 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;

/**
 * 

* An object representing the details of a container that is part of a job. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ContainerDetail implements Serializable, Cloneable, StructuredPojo { /** *

* The image used to start the container. *

*/ private String image; /** *

* The number of VCPUs allocated for the job. *

*/ private Integer vcpus; /** *

* The number of MiB of memory reserved for the job. *

*/ private Integer memory; /** *

* The command that is passed to the container. *

*/ private java.util.List command; /** *

* The Amazon Resource Name (ARN) associated with the job upon execution. *

*/ private String jobRoleArn; /** *

* A list of volumes associated with the job. *

*/ private java.util.List volumes; /** *

* The environment variables to pass to a container. *

*/ private java.util.List environment; /** *

* The mount points for data volumes in your container. *

*/ private java.util.List mountPoints; /** *

* When this parameter is true, the container is given read-only access to its root file system. *

*/ private Boolean readonlyRootFilesystem; /** *

* A list of ulimit values to set in the container. *

*/ private java.util.List ulimits; /** *

* When this parameter is true, the container is given elevated privileges on the host container instance (similar * to the root user). *

*/ private Boolean privileged; /** *

* The user name to use inside the container. *

*/ private String user; /** *

* The exit code to return upon completion. *

*/ private Integer exitCode; /** *

* A short (255 max characters) human-readable string to provide additional details about a running or stopped * container. *

*/ private String reason; /** *

* The Amazon Resource Name (ARN) of the container instance on which the container is running. *

*/ private String containerInstanceArn; /** *

* The image used to start the container. *

* * @param image * The image used to start the container. */ public void setImage(String image) { this.image = image; } /** *

* The image used to start the container. *

* * @return The image used to start the container. */ public String getImage() { return this.image; } /** *

* The image used to start the container. *

* * @param image * The image used to start the container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withImage(String image) { setImage(image); return this; } /** *

* The number of VCPUs allocated for the job. *

* * @param vcpus * The number of VCPUs allocated for the job. */ public void setVcpus(Integer vcpus) { this.vcpus = vcpus; } /** *

* The number of VCPUs allocated for the job. *

* * @return The number of VCPUs allocated for the job. */ public Integer getVcpus() { return this.vcpus; } /** *

* The number of VCPUs allocated for the job. *

* * @param vcpus * The number of VCPUs allocated for the job. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withVcpus(Integer vcpus) { setVcpus(vcpus); return this; } /** *

* The number of MiB of memory reserved for the job. *

* * @param memory * The number of MiB of memory reserved for the job. */ public void setMemory(Integer memory) { this.memory = memory; } /** *

* The number of MiB of memory reserved for the job. *

* * @return The number of MiB of memory reserved for the job. */ public Integer getMemory() { return this.memory; } /** *

* The number of MiB of memory reserved for the job. *

* * @param memory * The number of MiB of memory reserved for the job. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withMemory(Integer memory) { setMemory(memory); return this; } /** *

* The command that is passed to the container. *

* * @return The command that is passed to the container. */ public java.util.List getCommand() { return command; } /** *

* The command that is passed to the container. *

* * @param command * The command that is passed to the container. */ public void setCommand(java.util.Collection command) { if (command == null) { this.command = null; return; } this.command = new java.util.ArrayList(command); } /** *

* The command that is passed to the container. *

*

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

* * @param command * The command that is passed to the container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withCommand(String... command) { if (this.command == null) { setCommand(new java.util.ArrayList(command.length)); } for (String ele : command) { this.command.add(ele); } return this; } /** *

* The command that is passed to the container. *

* * @param command * The command that is passed to the container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withCommand(java.util.Collection command) { setCommand(command); return this; } /** *

* The Amazon Resource Name (ARN) associated with the job upon execution. *

* * @param jobRoleArn * The Amazon Resource Name (ARN) associated with the job upon execution. */ public void setJobRoleArn(String jobRoleArn) { this.jobRoleArn = jobRoleArn; } /** *

* The Amazon Resource Name (ARN) associated with the job upon execution. *

* * @return The Amazon Resource Name (ARN) associated with the job upon execution. */ public String getJobRoleArn() { return this.jobRoleArn; } /** *

* The Amazon Resource Name (ARN) associated with the job upon execution. *

* * @param jobRoleArn * The Amazon Resource Name (ARN) associated with the job upon execution. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withJobRoleArn(String jobRoleArn) { setJobRoleArn(jobRoleArn); return this; } /** *

* A list of volumes associated with the job. *

* * @return A list of volumes associated with the job. */ public java.util.List getVolumes() { return volumes; } /** *

* A list of volumes associated with the job. *

* * @param volumes * A list of volumes associated with the job. */ public void setVolumes(java.util.Collection volumes) { if (volumes == null) { this.volumes = null; return; } this.volumes = new java.util.ArrayList(volumes); } /** *

* A list of volumes associated with the job. *

*

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

* * @param volumes * A list of volumes associated with the job. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withVolumes(Volume... volumes) { if (this.volumes == null) { setVolumes(new java.util.ArrayList(volumes.length)); } for (Volume ele : volumes) { this.volumes.add(ele); } return this; } /** *

* A list of volumes associated with the job. *

* * @param volumes * A list of volumes associated with the job. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withVolumes(java.util.Collection volumes) { setVolumes(volumes); return this; } /** *

* The environment variables to pass to a container. *

* * @return The environment variables to pass to a container. */ public java.util.List getEnvironment() { return environment; } /** *

* The environment variables to pass to a container. *

* * @param environment * The environment variables to pass to a container. */ public void setEnvironment(java.util.Collection environment) { if (environment == null) { this.environment = null; return; } this.environment = new java.util.ArrayList(environment); } /** *

* The environment variables to pass to a container. *

*

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

* * @param environment * The environment variables to pass to a container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withEnvironment(KeyValuePair... environment) { if (this.environment == null) { setEnvironment(new java.util.ArrayList(environment.length)); } for (KeyValuePair ele : environment) { this.environment.add(ele); } return this; } /** *

* The environment variables to pass to a container. *

* * @param environment * The environment variables to pass to a container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withEnvironment(java.util.Collection environment) { setEnvironment(environment); return this; } /** *

* The mount points for data volumes in your container. *

* * @return The mount points for data volumes in your container. */ public java.util.List getMountPoints() { return mountPoints; } /** *

* The mount points for data volumes in your container. *

* * @param mountPoints * The mount points for data volumes in your container. */ public void setMountPoints(java.util.Collection mountPoints) { if (mountPoints == null) { this.mountPoints = null; return; } this.mountPoints = new java.util.ArrayList(mountPoints); } /** *

* The mount points for data volumes in your container. *

*

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

* * @param mountPoints * The mount points for data volumes in your container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withMountPoints(MountPoint... mountPoints) { if (this.mountPoints == null) { setMountPoints(new java.util.ArrayList(mountPoints.length)); } for (MountPoint ele : mountPoints) { this.mountPoints.add(ele); } return this; } /** *

* The mount points for data volumes in your container. *

* * @param mountPoints * The mount points for data volumes in your container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withMountPoints(java.util.Collection mountPoints) { setMountPoints(mountPoints); return this; } /** *

* When this parameter is true, the container is given read-only access to its root file system. *

* * @param readonlyRootFilesystem * When this parameter is true, the container is given read-only access to its root file system. */ public void setReadonlyRootFilesystem(Boolean readonlyRootFilesystem) { this.readonlyRootFilesystem = readonlyRootFilesystem; } /** *

* When this parameter is true, the container is given read-only access to its root file system. *

* * @return When this parameter is true, the container is given read-only access to its root file system. */ public Boolean getReadonlyRootFilesystem() { return this.readonlyRootFilesystem; } /** *

* When this parameter is true, the container is given read-only access to its root file system. *

* * @param readonlyRootFilesystem * When this parameter is true, the container is given read-only access to its root file system. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withReadonlyRootFilesystem(Boolean readonlyRootFilesystem) { setReadonlyRootFilesystem(readonlyRootFilesystem); return this; } /** *

* When this parameter is true, the container is given read-only access to its root file system. *

* * @return When this parameter is true, the container is given read-only access to its root file system. */ public Boolean isReadonlyRootFilesystem() { return this.readonlyRootFilesystem; } /** *

* A list of ulimit values to set in the container. *

* * @return A list of ulimit values to set in the container. */ public java.util.List getUlimits() { return ulimits; } /** *

* A list of ulimit values to set in the container. *

* * @param ulimits * A list of ulimit values to set in the container. */ public void setUlimits(java.util.Collection ulimits) { if (ulimits == null) { this.ulimits = null; return; } this.ulimits = new java.util.ArrayList(ulimits); } /** *

* A list of ulimit values to set in the container. *

*

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

* * @param ulimits * A list of ulimit values to set in the container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withUlimits(Ulimit... ulimits) { if (this.ulimits == null) { setUlimits(new java.util.ArrayList(ulimits.length)); } for (Ulimit ele : ulimits) { this.ulimits.add(ele); } return this; } /** *

* A list of ulimit values to set in the container. *

* * @param ulimits * A list of ulimit values to set in the container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withUlimits(java.util.Collection ulimits) { setUlimits(ulimits); return this; } /** *

* When this parameter is true, the container is given elevated privileges on the host container instance (similar * to the root user). *

* * @param privileged * When this parameter is true, the container is given elevated privileges on the host container instance * (similar to the root user). */ public void setPrivileged(Boolean privileged) { this.privileged = privileged; } /** *

* When this parameter is true, the container is given elevated privileges on the host container instance (similar * to the root user). *

* * @return When this parameter is true, the container is given elevated privileges on the host container instance * (similar to the root user). */ public Boolean getPrivileged() { return this.privileged; } /** *

* When this parameter is true, the container is given elevated privileges on the host container instance (similar * to the root user). *

* * @param privileged * When this parameter is true, the container is given elevated privileges on the host container instance * (similar to the root user). * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withPrivileged(Boolean privileged) { setPrivileged(privileged); return this; } /** *

* When this parameter is true, the container is given elevated privileges on the host container instance (similar * to the root user). *

* * @return When this parameter is true, the container is given elevated privileges on the host container instance * (similar to the root user). */ public Boolean isPrivileged() { return this.privileged; } /** *

* The user name to use inside the container. *

* * @param user * The user name to use inside the container. */ public void setUser(String user) { this.user = user; } /** *

* The user name to use inside the container. *

* * @return The user name to use inside the container. */ public String getUser() { return this.user; } /** *

* The user name to use inside the container. *

* * @param user * The user name to use inside the container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withUser(String user) { setUser(user); return this; } /** *

* The exit code to return upon completion. *

* * @param exitCode * The exit code to return upon completion. */ public void setExitCode(Integer exitCode) { this.exitCode = exitCode; } /** *

* The exit code to return upon completion. *

* * @return The exit code to return upon completion. */ public Integer getExitCode() { return this.exitCode; } /** *

* The exit code to return upon completion. *

* * @param exitCode * The exit code to return upon completion. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withExitCode(Integer exitCode) { setExitCode(exitCode); return this; } /** *

* A short (255 max characters) human-readable string to provide additional details about a running or stopped * container. *

* * @param reason * A short (255 max characters) human-readable string to provide additional details about a running or * stopped container. */ public void setReason(String reason) { this.reason = reason; } /** *

* A short (255 max characters) human-readable string to provide additional details about a running or stopped * container. *

* * @return A short (255 max characters) human-readable string to provide additional details about a running or * stopped container. */ public String getReason() { return this.reason; } /** *

* A short (255 max characters) human-readable string to provide additional details about a running or stopped * container. *

* * @param reason * A short (255 max characters) human-readable string to provide additional details about a running or * stopped container. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withReason(String reason) { setReason(reason); return this; } /** *

* The Amazon Resource Name (ARN) of the container instance on which the container is running. *

* * @param containerInstanceArn * The Amazon Resource Name (ARN) of the container instance on which the container is running. */ public void setContainerInstanceArn(String containerInstanceArn) { this.containerInstanceArn = containerInstanceArn; } /** *

* The Amazon Resource Name (ARN) of the container instance on which the container is running. *

* * @return The Amazon Resource Name (ARN) of the container instance on which the container is running. */ public String getContainerInstanceArn() { return this.containerInstanceArn; } /** *

* The Amazon Resource Name (ARN) of the container instance on which the container is running. *

* * @param containerInstanceArn * The Amazon Resource Name (ARN) of the container instance on which the container is running. * @return Returns a reference to this object so that method calls can be chained together. */ public ContainerDetail withContainerInstanceArn(String containerInstanceArn) { setContainerInstanceArn(containerInstanceArn); 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 (getImage() != null) sb.append("Image: ").append(getImage()).append(","); if (getVcpus() != null) sb.append("Vcpus: ").append(getVcpus()).append(","); if (getMemory() != null) sb.append("Memory: ").append(getMemory()).append(","); if (getCommand() != null) sb.append("Command: ").append(getCommand()).append(","); if (getJobRoleArn() != null) sb.append("JobRoleArn: ").append(getJobRoleArn()).append(","); if (getVolumes() != null) sb.append("Volumes: ").append(getVolumes()).append(","); if (getEnvironment() != null) sb.append("Environment: ").append(getEnvironment()).append(","); if (getMountPoints() != null) sb.append("MountPoints: ").append(getMountPoints()).append(","); if (getReadonlyRootFilesystem() != null) sb.append("ReadonlyRootFilesystem: ").append(getReadonlyRootFilesystem()).append(","); if (getUlimits() != null) sb.append("Ulimits: ").append(getUlimits()).append(","); if (getPrivileged() != null) sb.append("Privileged: ").append(getPrivileged()).append(","); if (getUser() != null) sb.append("User: ").append(getUser()).append(","); if (getExitCode() != null) sb.append("ExitCode: ").append(getExitCode()).append(","); if (getReason() != null) sb.append("Reason: ").append(getReason()).append(","); if (getContainerInstanceArn() != null) sb.append("ContainerInstanceArn: ").append(getContainerInstanceArn()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ContainerDetail == false) return false; ContainerDetail other = (ContainerDetail) obj; if (other.getImage() == null ^ this.getImage() == null) return false; if (other.getImage() != null && other.getImage().equals(this.getImage()) == false) return false; if (other.getVcpus() == null ^ this.getVcpus() == null) return false; if (other.getVcpus() != null && other.getVcpus().equals(this.getVcpus()) == false) return false; if (other.getMemory() == null ^ this.getMemory() == null) return false; if (other.getMemory() != null && other.getMemory().equals(this.getMemory()) == false) return false; if (other.getCommand() == null ^ this.getCommand() == null) return false; if (other.getCommand() != null && other.getCommand().equals(this.getCommand()) == false) return false; if (other.getJobRoleArn() == null ^ this.getJobRoleArn() == null) return false; if (other.getJobRoleArn() != null && other.getJobRoleArn().equals(this.getJobRoleArn()) == false) return false; if (other.getVolumes() == null ^ this.getVolumes() == null) return false; if (other.getVolumes() != null && other.getVolumes().equals(this.getVolumes()) == false) return false; if (other.getEnvironment() == null ^ this.getEnvironment() == null) return false; if (other.getEnvironment() != null && other.getEnvironment().equals(this.getEnvironment()) == false) return false; if (other.getMountPoints() == null ^ this.getMountPoints() == null) return false; if (other.getMountPoints() != null && other.getMountPoints().equals(this.getMountPoints()) == false) return false; if (other.getReadonlyRootFilesystem() == null ^ this.getReadonlyRootFilesystem() == null) return false; if (other.getReadonlyRootFilesystem() != null && other.getReadonlyRootFilesystem().equals(this.getReadonlyRootFilesystem()) == false) return false; if (other.getUlimits() == null ^ this.getUlimits() == null) return false; if (other.getUlimits() != null && other.getUlimits().equals(this.getUlimits()) == false) return false; if (other.getPrivileged() == null ^ this.getPrivileged() == null) return false; if (other.getPrivileged() != null && other.getPrivileged().equals(this.getPrivileged()) == false) return false; if (other.getUser() == null ^ this.getUser() == null) return false; if (other.getUser() != null && other.getUser().equals(this.getUser()) == false) return false; if (other.getExitCode() == null ^ this.getExitCode() == null) return false; if (other.getExitCode() != null && other.getExitCode().equals(this.getExitCode()) == false) return false; if (other.getReason() == null ^ this.getReason() == null) return false; if (other.getReason() != null && other.getReason().equals(this.getReason()) == false) return false; if (other.getContainerInstanceArn() == null ^ this.getContainerInstanceArn() == null) return false; if (other.getContainerInstanceArn() != null && other.getContainerInstanceArn().equals(this.getContainerInstanceArn()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getImage() == null) ? 0 : getImage().hashCode()); hashCode = prime * hashCode + ((getVcpus() == null) ? 0 : getVcpus().hashCode()); hashCode = prime * hashCode + ((getMemory() == null) ? 0 : getMemory().hashCode()); hashCode = prime * hashCode + ((getCommand() == null) ? 0 : getCommand().hashCode()); hashCode = prime * hashCode + ((getJobRoleArn() == null) ? 0 : getJobRoleArn().hashCode()); hashCode = prime * hashCode + ((getVolumes() == null) ? 0 : getVolumes().hashCode()); hashCode = prime * hashCode + ((getEnvironment() == null) ? 0 : getEnvironment().hashCode()); hashCode = prime * hashCode + ((getMountPoints() == null) ? 0 : getMountPoints().hashCode()); hashCode = prime * hashCode + ((getReadonlyRootFilesystem() == null) ? 0 : getReadonlyRootFilesystem().hashCode()); hashCode = prime * hashCode + ((getUlimits() == null) ? 0 : getUlimits().hashCode()); hashCode = prime * hashCode + ((getPrivileged() == null) ? 0 : getPrivileged().hashCode()); hashCode = prime * hashCode + ((getUser() == null) ? 0 : getUser().hashCode()); hashCode = prime * hashCode + ((getExitCode() == null) ? 0 : getExitCode().hashCode()); hashCode = prime * hashCode + ((getReason() == null) ? 0 : getReason().hashCode()); hashCode = prime * hashCode + ((getContainerInstanceArn() == null) ? 0 : getContainerInstanceArn().hashCode()); return hashCode; } @Override public ContainerDetail clone() { try { return (ContainerDetail) 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.ContainerDetailMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy