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

com.amazonaws.services.ecs.model.Container Maven / Gradle / Ivy

/*
 * Copyright 2013-2018 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.ecs.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* A Docker container that is part of a task. *

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

* The Amazon Resource Name (ARN) of the container. *

*/ private String containerArn; /** *

* The ARN of the task. *

*/ private String taskArn; /** *

* The name of the container. *

*/ private String name; /** *

* The last known status of the container. *

*/ private String lastStatus; /** *

* The exit code returned from the container. *

*/ 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 network bindings associated with the container. *

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

* The network interfaces associated with the container. *

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

* The health status of the container. If health checks are not configured for this container in its task * definition, then it reports health status as UNKNOWN. *

*/ private String healthStatus; /** *

* The Amazon Resource Name (ARN) of the container. *

* * @param containerArn * The Amazon Resource Name (ARN) of the container. */ public void setContainerArn(String containerArn) { this.containerArn = containerArn; } /** *

* The Amazon Resource Name (ARN) of the container. *

* * @return The Amazon Resource Name (ARN) of the container. */ public String getContainerArn() { return this.containerArn; } /** *

* The Amazon Resource Name (ARN) of the container. *

* * @param containerArn * The Amazon Resource Name (ARN) of the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withContainerArn(String containerArn) { setContainerArn(containerArn); return this; } /** *

* The ARN of the task. *

* * @param taskArn * The ARN of the task. */ public void setTaskArn(String taskArn) { this.taskArn = taskArn; } /** *

* The ARN of the task. *

* * @return The ARN of the task. */ public String getTaskArn() { return this.taskArn; } /** *

* The ARN of the task. *

* * @param taskArn * The ARN of the task. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withTaskArn(String taskArn) { setTaskArn(taskArn); return this; } /** *

* The name of the container. *

* * @param name * The name of the container. */ public void setName(String name) { this.name = name; } /** *

* The name of the container. *

* * @return The name of the container. */ public String getName() { return this.name; } /** *

* The name of the container. *

* * @param name * The name of the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withName(String name) { setName(name); return this; } /** *

* The last known status of the container. *

* * @param lastStatus * The last known status of the container. */ public void setLastStatus(String lastStatus) { this.lastStatus = lastStatus; } /** *

* The last known status of the container. *

* * @return The last known status of the container. */ public String getLastStatus() { return this.lastStatus; } /** *

* The last known status of the container. *

* * @param lastStatus * The last known status of the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withLastStatus(String lastStatus) { setLastStatus(lastStatus); return this; } /** *

* The exit code returned from the container. *

* * @param exitCode * The exit code returned from the container. */ public void setExitCode(Integer exitCode) { this.exitCode = exitCode; } /** *

* The exit code returned from the container. *

* * @return The exit code returned from the container. */ public Integer getExitCode() { return this.exitCode; } /** *

* The exit code returned from the container. *

* * @param exitCode * The exit code returned from the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container 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 Container withReason(String reason) { setReason(reason); return this; } /** *

* The network bindings associated with the container. *

* * @return The network bindings associated with the container. */ public java.util.List getNetworkBindings() { if (networkBindings == null) { networkBindings = new com.amazonaws.internal.SdkInternalList(); } return networkBindings; } /** *

* The network bindings associated with the container. *

* * @param networkBindings * The network bindings associated with the container. */ public void setNetworkBindings(java.util.Collection networkBindings) { if (networkBindings == null) { this.networkBindings = null; return; } this.networkBindings = new com.amazonaws.internal.SdkInternalList(networkBindings); } /** *

* The network bindings associated with the container. *

*

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

* * @param networkBindings * The network bindings associated with the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withNetworkBindings(NetworkBinding... networkBindings) { if (this.networkBindings == null) { setNetworkBindings(new com.amazonaws.internal.SdkInternalList(networkBindings.length)); } for (NetworkBinding ele : networkBindings) { this.networkBindings.add(ele); } return this; } /** *

* The network bindings associated with the container. *

* * @param networkBindings * The network bindings associated with the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withNetworkBindings(java.util.Collection networkBindings) { setNetworkBindings(networkBindings); return this; } /** *

* The network interfaces associated with the container. *

* * @return The network interfaces associated with the container. */ public java.util.List getNetworkInterfaces() { if (networkInterfaces == null) { networkInterfaces = new com.amazonaws.internal.SdkInternalList(); } return networkInterfaces; } /** *

* The network interfaces associated with the container. *

* * @param networkInterfaces * The network interfaces associated with the container. */ public void setNetworkInterfaces(java.util.Collection networkInterfaces) { if (networkInterfaces == null) { this.networkInterfaces = null; return; } this.networkInterfaces = new com.amazonaws.internal.SdkInternalList(networkInterfaces); } /** *

* The network interfaces associated with the container. *

*

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

* * @param networkInterfaces * The network interfaces associated with the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withNetworkInterfaces(NetworkInterface... networkInterfaces) { if (this.networkInterfaces == null) { setNetworkInterfaces(new com.amazonaws.internal.SdkInternalList(networkInterfaces.length)); } for (NetworkInterface ele : networkInterfaces) { this.networkInterfaces.add(ele); } return this; } /** *

* The network interfaces associated with the container. *

* * @param networkInterfaces * The network interfaces associated with the container. * @return Returns a reference to this object so that method calls can be chained together. */ public Container withNetworkInterfaces(java.util.Collection networkInterfaces) { setNetworkInterfaces(networkInterfaces); return this; } /** *

* The health status of the container. If health checks are not configured for this container in its task * definition, then it reports health status as UNKNOWN. *

* * @param healthStatus * The health status of the container. If health checks are not configured for this container in its task * definition, then it reports health status as UNKNOWN. * @see HealthStatus */ public void setHealthStatus(String healthStatus) { this.healthStatus = healthStatus; } /** *

* The health status of the container. If health checks are not configured for this container in its task * definition, then it reports health status as UNKNOWN. *

* * @return The health status of the container. If health checks are not configured for this container in its task * definition, then it reports health status as UNKNOWN. * @see HealthStatus */ public String getHealthStatus() { return this.healthStatus; } /** *

* The health status of the container. If health checks are not configured for this container in its task * definition, then it reports health status as UNKNOWN. *

* * @param healthStatus * The health status of the container. If health checks are not configured for this container in its task * definition, then it reports health status as UNKNOWN. * @return Returns a reference to this object so that method calls can be chained together. * @see HealthStatus */ public Container withHealthStatus(String healthStatus) { setHealthStatus(healthStatus); return this; } /** *

* The health status of the container. If health checks are not configured for this container in its task * definition, then it reports health status as UNKNOWN. *

* * @param healthStatus * The health status of the container. If health checks are not configured for this container in its task * definition, then it reports health status as UNKNOWN. * @return Returns a reference to this object so that method calls can be chained together. * @see HealthStatus */ public Container withHealthStatus(HealthStatus healthStatus) { this.healthStatus = healthStatus.toString(); 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 (getContainerArn() != null) sb.append("ContainerArn: ").append(getContainerArn()).append(","); if (getTaskArn() != null) sb.append("TaskArn: ").append(getTaskArn()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getLastStatus() != null) sb.append("LastStatus: ").append(getLastStatus()).append(","); if (getExitCode() != null) sb.append("ExitCode: ").append(getExitCode()).append(","); if (getReason() != null) sb.append("Reason: ").append(getReason()).append(","); if (getNetworkBindings() != null) sb.append("NetworkBindings: ").append(getNetworkBindings()).append(","); if (getNetworkInterfaces() != null) sb.append("NetworkInterfaces: ").append(getNetworkInterfaces()).append(","); if (getHealthStatus() != null) sb.append("HealthStatus: ").append(getHealthStatus()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Container == false) return false; Container other = (Container) obj; if (other.getContainerArn() == null ^ this.getContainerArn() == null) return false; if (other.getContainerArn() != null && other.getContainerArn().equals(this.getContainerArn()) == false) return false; if (other.getTaskArn() == null ^ this.getTaskArn() == null) return false; if (other.getTaskArn() != null && other.getTaskArn().equals(this.getTaskArn()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getLastStatus() == null ^ this.getLastStatus() == null) return false; if (other.getLastStatus() != null && other.getLastStatus().equals(this.getLastStatus()) == 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.getNetworkBindings() == null ^ this.getNetworkBindings() == null) return false; if (other.getNetworkBindings() != null && other.getNetworkBindings().equals(this.getNetworkBindings()) == false) return false; if (other.getNetworkInterfaces() == null ^ this.getNetworkInterfaces() == null) return false; if (other.getNetworkInterfaces() != null && other.getNetworkInterfaces().equals(this.getNetworkInterfaces()) == false) return false; if (other.getHealthStatus() == null ^ this.getHealthStatus() == null) return false; if (other.getHealthStatus() != null && other.getHealthStatus().equals(this.getHealthStatus()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getContainerArn() == null) ? 0 : getContainerArn().hashCode()); hashCode = prime * hashCode + ((getTaskArn() == null) ? 0 : getTaskArn().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getLastStatus() == null) ? 0 : getLastStatus().hashCode()); hashCode = prime * hashCode + ((getExitCode() == null) ? 0 : getExitCode().hashCode()); hashCode = prime * hashCode + ((getReason() == null) ? 0 : getReason().hashCode()); hashCode = prime * hashCode + ((getNetworkBindings() == null) ? 0 : getNetworkBindings().hashCode()); hashCode = prime * hashCode + ((getNetworkInterfaces() == null) ? 0 : getNetworkInterfaces().hashCode()); hashCode = prime * hashCode + ((getHealthStatus() == null) ? 0 : getHealthStatus().hashCode()); return hashCode; } @Override public Container clone() { try { return (Container) 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.ecs.model.transform.ContainerMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy