
com.amazonaws.services.codepipeline.model.PipelineExecution Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codepipeline Show documentation
/*
* Copyright 2011-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.codepipeline.model;
import java.io.Serializable;
/**
*
* Represents information about an execution of a pipeline.
*
*/
public class PipelineExecution implements Serializable, Cloneable {
/**
*
* The name of the pipeline that was executed.
*
*/
private String pipelineName;
/**
*
* The version number of the pipeline that was executed.
*
*/
private Integer pipelineVersion;
/**
*
* The ID of the pipeline execution.
*
*/
private String pipelineExecutionId;
/**
*
* The status of the pipeline execution.
*
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline
* execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
*
*/
private String status;
/**
*
* A list of ArtifactRevision objects included in a pipeline execution.
*
*/
private java.util.List artifactRevisions;
/**
*
* The name of the pipeline that was executed.
*
*
* @param pipelineName
* The name of the pipeline that was executed.
*/
public void setPipelineName(String pipelineName) {
this.pipelineName = pipelineName;
}
/**
*
* The name of the pipeline that was executed.
*
*
* @return The name of the pipeline that was executed.
*/
public String getPipelineName() {
return this.pipelineName;
}
/**
*
* The name of the pipeline that was executed.
*
*
* @param pipelineName
* The name of the pipeline that was executed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PipelineExecution withPipelineName(String pipelineName) {
setPipelineName(pipelineName);
return this;
}
/**
*
* The version number of the pipeline that was executed.
*
*
* @param pipelineVersion
* The version number of the pipeline that was executed.
*/
public void setPipelineVersion(Integer pipelineVersion) {
this.pipelineVersion = pipelineVersion;
}
/**
*
* The version number of the pipeline that was executed.
*
*
* @return The version number of the pipeline that was executed.
*/
public Integer getPipelineVersion() {
return this.pipelineVersion;
}
/**
*
* The version number of the pipeline that was executed.
*
*
* @param pipelineVersion
* The version number of the pipeline that was executed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PipelineExecution withPipelineVersion(Integer pipelineVersion) {
setPipelineVersion(pipelineVersion);
return this;
}
/**
*
* The ID of the pipeline execution.
*
*
* @param pipelineExecutionId
* The ID of the pipeline execution.
*/
public void setPipelineExecutionId(String pipelineExecutionId) {
this.pipelineExecutionId = pipelineExecutionId;
}
/**
*
* The ID of the pipeline execution.
*
*
* @return The ID of the pipeline execution.
*/
public String getPipelineExecutionId() {
return this.pipelineExecutionId;
}
/**
*
* The ID of the pipeline execution.
*
*
* @param pipelineExecutionId
* The ID of the pipeline execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PipelineExecution withPipelineExecutionId(String pipelineExecutionId) {
setPipelineExecutionId(pipelineExecutionId);
return this;
}
/**
*
* The status of the pipeline execution.
*
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline
* execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
*
*
* @param status
* The status of the pipeline execution.
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline
* execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
* @see PipelineExecutionStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the pipeline execution.
*
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline
* execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
*
*
* @return The status of the pipeline execution.
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer
* pipeline execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
* @see PipelineExecutionStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the pipeline execution.
*
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline
* execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
*
*
* @param status
* The status of the pipeline execution.
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline
* execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see PipelineExecutionStatus
*/
public PipelineExecution withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status of the pipeline execution.
*
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline
* execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
*
*
* @param status
* The status of the pipeline execution.
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline
* execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
* @see PipelineExecutionStatus
*/
public void setStatus(PipelineExecutionStatus status) {
this.status = status.toString();
}
/**
*
* The status of the pipeline execution.
*
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline
* execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
*
*
* @param status
* The status of the pipeline execution.
*
* -
*
* InProgress: The pipeline execution is currently running.
*
*
* -
*
* Succeeded: The pipeline execution completed successfully.
*
*
* -
*
* Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline
* execution caught up and continued through the pipeline instead.
*
*
* -
*
* Failed: The pipeline did not complete successfully.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see PipelineExecutionStatus
*/
public PipelineExecution withStatus(PipelineExecutionStatus status) {
setStatus(status);
return this;
}
/**
*
* A list of ArtifactRevision objects included in a pipeline execution.
*
*
* @return A list of ArtifactRevision objects included in a pipeline execution.
*/
public java.util.List getArtifactRevisions() {
return artifactRevisions;
}
/**
*
* A list of ArtifactRevision objects included in a pipeline execution.
*
*
* @param artifactRevisions
* A list of ArtifactRevision objects included in a pipeline execution.
*/
public void setArtifactRevisions(java.util.Collection artifactRevisions) {
if (artifactRevisions == null) {
this.artifactRevisions = null;
return;
}
this.artifactRevisions = new java.util.ArrayList(artifactRevisions);
}
/**
*
* A list of ArtifactRevision objects included in a pipeline execution.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setArtifactRevisions(java.util.Collection)} or {@link #withArtifactRevisions(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param artifactRevisions
* A list of ArtifactRevision objects included in a pipeline execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PipelineExecution withArtifactRevisions(ArtifactRevision... artifactRevisions) {
if (this.artifactRevisions == null) {
setArtifactRevisions(new java.util.ArrayList(artifactRevisions.length));
}
for (ArtifactRevision ele : artifactRevisions) {
this.artifactRevisions.add(ele);
}
return this;
}
/**
*
* A list of ArtifactRevision objects included in a pipeline execution.
*
*
* @param artifactRevisions
* A list of ArtifactRevision objects included in a pipeline execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PipelineExecution withArtifactRevisions(java.util.Collection artifactRevisions) {
setArtifactRevisions(artifactRevisions);
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 (getPipelineName() != null)
sb.append("PipelineName: " + getPipelineName() + ",");
if (getPipelineVersion() != null)
sb.append("PipelineVersion: " + getPipelineVersion() + ",");
if (getPipelineExecutionId() != null)
sb.append("PipelineExecutionId: " + getPipelineExecutionId() + ",");
if (getStatus() != null)
sb.append("Status: " + getStatus() + ",");
if (getArtifactRevisions() != null)
sb.append("ArtifactRevisions: " + getArtifactRevisions());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PipelineExecution == false)
return false;
PipelineExecution other = (PipelineExecution) obj;
if (other.getPipelineName() == null ^ this.getPipelineName() == null)
return false;
if (other.getPipelineName() != null && other.getPipelineName().equals(this.getPipelineName()) == false)
return false;
if (other.getPipelineVersion() == null ^ this.getPipelineVersion() == null)
return false;
if (other.getPipelineVersion() != null && other.getPipelineVersion().equals(this.getPipelineVersion()) == false)
return false;
if (other.getPipelineExecutionId() == null ^ this.getPipelineExecutionId() == null)
return false;
if (other.getPipelineExecutionId() != null && other.getPipelineExecutionId().equals(this.getPipelineExecutionId()) == 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.getArtifactRevisions() == null ^ this.getArtifactRevisions() == null)
return false;
if (other.getArtifactRevisions() != null && other.getArtifactRevisions().equals(this.getArtifactRevisions()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPipelineName() == null) ? 0 : getPipelineName().hashCode());
hashCode = prime * hashCode + ((getPipelineVersion() == null) ? 0 : getPipelineVersion().hashCode());
hashCode = prime * hashCode + ((getPipelineExecutionId() == null) ? 0 : getPipelineExecutionId().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getArtifactRevisions() == null) ? 0 : getArtifactRevisions().hashCode());
return hashCode;
}
@Override
public PipelineExecution clone() {
try {
return (PipelineExecution) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}