com.amazonaws.services.ecs.model.Deployment Maven / Gradle / Ivy
/*
* Copyright 2010-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.ecs.model;
import java.io.Serializable;
/**
*
* The details of an Amazon ECS service deployment.
*
*/
public class Deployment implements Serializable, Cloneable {
/**
*
* The ID of the deployment.
*
*/
private String id;
/**
*
* The status of the deployment. Valid values are PRIMARY
(for
* the most recent deployment), ACTIVE
(for previous
* deployments that still have tasks running, but are being replaced with
* the PRIMARY
deployment), and INACTIVE
(for
* deployments that have been completely replaced).
*
*/
private String status;
/**
*
* The most recent task definition that was specified for the service to
* use.
*
*/
private String taskDefinition;
/**
*
* The most recent desired count of tasks that was specified for the service
* to deploy or maintain.
*
*/
private Integer desiredCount;
/**
*
* The number of tasks in the deployment that are in the
* PENDING
status.
*
*/
private Integer pendingCount;
/**
*
* The number of tasks in the deployment that are in the
* RUNNING
status.
*
*/
private Integer runningCount;
/**
*
* The Unix time in seconds and milliseconds when the service was created.
*
*/
private java.util.Date createdAt;
/**
*
* The Unix time in seconds and milliseconds when the service was last
* updated.
*
*/
private java.util.Date updatedAt;
/**
*
* The ID of the deployment.
*
*
* @param id
* The ID of the deployment.
*/
public void setId(String id) {
this.id = id;
}
/**
*
* The ID of the deployment.
*
*
* @return The ID of the deployment.
*/
public String getId() {
return this.id;
}
/**
*
* The ID of the deployment.
*
*
* @param id
* The ID of the deployment.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Deployment withId(String id) {
setId(id);
return this;
}
/**
*
* The status of the deployment. Valid values are PRIMARY
(for
* the most recent deployment), ACTIVE
(for previous
* deployments that still have tasks running, but are being replaced with
* the PRIMARY
deployment), and INACTIVE
(for
* deployments that have been completely replaced).
*
*
* @param status
* The status of the deployment. Valid values are
* PRIMARY
(for the most recent deployment),
* ACTIVE
(for previous deployments that still have
* tasks running, but are being replaced with the
* PRIMARY
deployment), and INACTIVE
(for
* deployments that have been completely replaced).
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the deployment. Valid values are PRIMARY
(for
* the most recent deployment), ACTIVE
(for previous
* deployments that still have tasks running, but are being replaced with
* the PRIMARY
deployment), and INACTIVE
(for
* deployments that have been completely replaced).
*
*
* @return The status of the deployment. Valid values are
* PRIMARY
(for the most recent deployment),
* ACTIVE
(for previous deployments that still have
* tasks running, but are being replaced with the
* PRIMARY
deployment), and INACTIVE
(for
* deployments that have been completely replaced).
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the deployment. Valid values are PRIMARY
(for
* the most recent deployment), ACTIVE
(for previous
* deployments that still have tasks running, but are being replaced with
* the PRIMARY
deployment), and INACTIVE
(for
* deployments that have been completely replaced).
*
*
* @param status
* The status of the deployment. Valid values are
* PRIMARY
(for the most recent deployment),
* ACTIVE
(for previous deployments that still have
* tasks running, but are being replaced with the
* PRIMARY
deployment), and INACTIVE
(for
* deployments that have been completely replaced).
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Deployment withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The most recent task definition that was specified for the service to
* use.
*
*
* @param taskDefinition
* The most recent task definition that was specified for the service
* to use.
*/
public void setTaskDefinition(String taskDefinition) {
this.taskDefinition = taskDefinition;
}
/**
*
* The most recent task definition that was specified for the service to
* use.
*
*
* @return The most recent task definition that was specified for the
* service to use.
*/
public String getTaskDefinition() {
return this.taskDefinition;
}
/**
*
* The most recent task definition that was specified for the service to
* use.
*
*
* @param taskDefinition
* The most recent task definition that was specified for the service
* to use.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Deployment withTaskDefinition(String taskDefinition) {
setTaskDefinition(taskDefinition);
return this;
}
/**
*
* The most recent desired count of tasks that was specified for the service
* to deploy or maintain.
*
*
* @param desiredCount
* The most recent desired count of tasks that was specified for the
* service to deploy or maintain.
*/
public void setDesiredCount(Integer desiredCount) {
this.desiredCount = desiredCount;
}
/**
*
* The most recent desired count of tasks that was specified for the service
* to deploy or maintain.
*
*
* @return The most recent desired count of tasks that was specified for the
* service to deploy or maintain.
*/
public Integer getDesiredCount() {
return this.desiredCount;
}
/**
*
* The most recent desired count of tasks that was specified for the service
* to deploy or maintain.
*
*
* @param desiredCount
* The most recent desired count of tasks that was specified for the
* service to deploy or maintain.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Deployment withDesiredCount(Integer desiredCount) {
setDesiredCount(desiredCount);
return this;
}
/**
*
* The number of tasks in the deployment that are in the
* PENDING
status.
*
*
* @param pendingCount
* The number of tasks in the deployment that are in the
* PENDING
status.
*/
public void setPendingCount(Integer pendingCount) {
this.pendingCount = pendingCount;
}
/**
*
* The number of tasks in the deployment that are in the
* PENDING
status.
*
*
* @return The number of tasks in the deployment that are in the
* PENDING
status.
*/
public Integer getPendingCount() {
return this.pendingCount;
}
/**
*
* The number of tasks in the deployment that are in the
* PENDING
status.
*
*
* @param pendingCount
* The number of tasks in the deployment that are in the
* PENDING
status.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Deployment withPendingCount(Integer pendingCount) {
setPendingCount(pendingCount);
return this;
}
/**
*
* The number of tasks in the deployment that are in the
* RUNNING
status.
*
*
* @param runningCount
* The number of tasks in the deployment that are in the
* RUNNING
status.
*/
public void setRunningCount(Integer runningCount) {
this.runningCount = runningCount;
}
/**
*
* The number of tasks in the deployment that are in the
* RUNNING
status.
*
*
* @return The number of tasks in the deployment that are in the
* RUNNING
status.
*/
public Integer getRunningCount() {
return this.runningCount;
}
/**
*
* The number of tasks in the deployment that are in the
* RUNNING
status.
*
*
* @param runningCount
* The number of tasks in the deployment that are in the
* RUNNING
status.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Deployment withRunningCount(Integer runningCount) {
setRunningCount(runningCount);
return this;
}
/**
*
* The Unix time in seconds and milliseconds when the service was created.
*
*
* @param createdAt
* The Unix time in seconds and milliseconds when the service was
* created.
*/
public void setCreatedAt(java.util.Date createdAt) {
this.createdAt = createdAt;
}
/**
*
* The Unix time in seconds and milliseconds when the service was created.
*
*
* @return The Unix time in seconds and milliseconds when the service was
* created.
*/
public java.util.Date getCreatedAt() {
return this.createdAt;
}
/**
*
* The Unix time in seconds and milliseconds when the service was created.
*
*
* @param createdAt
* The Unix time in seconds and milliseconds when the service was
* created.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Deployment withCreatedAt(java.util.Date createdAt) {
setCreatedAt(createdAt);
return this;
}
/**
*
* The Unix time in seconds and milliseconds when the service was last
* updated.
*
*
* @param updatedAt
* The Unix time in seconds and milliseconds when the service was
* last updated.
*/
public void setUpdatedAt(java.util.Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
*
* The Unix time in seconds and milliseconds when the service was last
* updated.
*
*
* @return The Unix time in seconds and milliseconds when the service was
* last updated.
*/
public java.util.Date getUpdatedAt() {
return this.updatedAt;
}
/**
*
* The Unix time in seconds and milliseconds when the service was last
* updated.
*
*
* @param updatedAt
* The Unix time in seconds and milliseconds when the service was
* last updated.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Deployment withUpdatedAt(java.util.Date updatedAt) {
setUpdatedAt(updatedAt);
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 (getId() != null)
sb.append("Id: " + getId() + ",");
if (getStatus() != null)
sb.append("Status: " + getStatus() + ",");
if (getTaskDefinition() != null)
sb.append("TaskDefinition: " + getTaskDefinition() + ",");
if (getDesiredCount() != null)
sb.append("DesiredCount: " + getDesiredCount() + ",");
if (getPendingCount() != null)
sb.append("PendingCount: " + getPendingCount() + ",");
if (getRunningCount() != null)
sb.append("RunningCount: " + getRunningCount() + ",");
if (getCreatedAt() != null)
sb.append("CreatedAt: " + getCreatedAt() + ",");
if (getUpdatedAt() != null)
sb.append("UpdatedAt: " + getUpdatedAt());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Deployment == false)
return false;
Deployment other = (Deployment) obj;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null
&& other.getId().equals(this.getId()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null
&& other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getTaskDefinition() == null
^ this.getTaskDefinition() == null)
return false;
if (other.getTaskDefinition() != null
&& other.getTaskDefinition().equals(this.getTaskDefinition()) == false)
return false;
if (other.getDesiredCount() == null ^ this.getDesiredCount() == null)
return false;
if (other.getDesiredCount() != null
&& other.getDesiredCount().equals(this.getDesiredCount()) == false)
return false;
if (other.getPendingCount() == null ^ this.getPendingCount() == null)
return false;
if (other.getPendingCount() != null
&& other.getPendingCount().equals(this.getPendingCount()) == false)
return false;
if (other.getRunningCount() == null ^ this.getRunningCount() == null)
return false;
if (other.getRunningCount() != null
&& other.getRunningCount().equals(this.getRunningCount()) == false)
return false;
if (other.getCreatedAt() == null ^ this.getCreatedAt() == null)
return false;
if (other.getCreatedAt() != null
&& other.getCreatedAt().equals(this.getCreatedAt()) == false)
return false;
if (other.getUpdatedAt() == null ^ this.getUpdatedAt() == null)
return false;
if (other.getUpdatedAt() != null
&& other.getUpdatedAt().equals(this.getUpdatedAt()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode
+ ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode
+ ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime
* hashCode
+ ((getTaskDefinition() == null) ? 0 : getTaskDefinition()
.hashCode());
hashCode = prime
* hashCode
+ ((getDesiredCount() == null) ? 0 : getDesiredCount()
.hashCode());
hashCode = prime
* hashCode
+ ((getPendingCount() == null) ? 0 : getPendingCount()
.hashCode());
hashCode = prime
* hashCode
+ ((getRunningCount() == null) ? 0 : getRunningCount()
.hashCode());
hashCode = prime * hashCode
+ ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
hashCode = prime * hashCode
+ ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
return hashCode;
}
@Override
public Deployment clone() {
try {
return (Deployment) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!", e);
}
}
}