Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.codedeploy.model;
 

Diagnostic information about executable scripts that are part of a deployment.

 
 public class Diagnostics implements SerializableCloneable {

    
The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.

Constraints:
Allowed Values: Success, ScriptMissing, ScriptNotExecutable, ScriptTimedOut, ScriptFailed, UnknownError

 
     private String errorCode;

    
The name of the script.
 
     private String scriptName;

    
The message associated with the error.
 
     private String message;

    
The last portion of the associated diagnostic log.
 
     private String logTail;

    
The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.

Constraints:
Allowed Values: Success, ScriptMissing, ScriptNotExecutable, ScriptTimedOut, ScriptFailed, UnknownError

Returns:
The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.
See also:
LifecycleErrorCode
 
     public String getErrorCode() {
         return ;
     }
    
    
The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.

Constraints:
Allowed Values: Success, ScriptMissing, ScriptNotExecutable, ScriptTimedOut, ScriptFailed, UnknownError

Parameters:
errorCode The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.
See also:
LifecycleErrorCode
    public void setErrorCode(String errorCode) {
        this. = errorCode;
    }
    
    
The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Success, ScriptMissing, ScriptNotExecutable, ScriptTimedOut, ScriptFailed, UnknownError

Parameters:
errorCode The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
LifecycleErrorCode
    public Diagnostics withErrorCode(String errorCode) {
        this. = errorCode;
        return this;
    }

    
The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.

Constraints:
Allowed Values: Success, ScriptMissing, ScriptNotExecutable, ScriptTimedOut, ScriptFailed, UnknownError

Parameters:
errorCode The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.
See also:
LifecycleErrorCode
    public void setErrorCode(LifecycleErrorCode errorCode) {
        this. = errorCode.toString();
    }
    
    
The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Success, ScriptMissing, ScriptNotExecutable, ScriptTimedOut, ScriptFailed, UnknownError

Parameters:
errorCode The associated error code:
  • Success: The specified script ran.
  • ScriptMissing: The specified script was not found in the specified location.
  • ScriptNotExecutable: The specified script is not a recognized executable file type.
  • ScriptTimedOut: The specified script did not finish running in the specified time period.
  • ScriptFailed: The specified script failed to run as expected.
  • UnknownError: The specified script did not run for an unknown reason.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
LifecycleErrorCode
    public Diagnostics withErrorCode(LifecycleErrorCode errorCode) {
        this. = errorCode.toString();
        return this;
    }

    
The name of the script.

Returns:
The name of the script.
    public String getScriptName() {
        return ;
    }
    
    
The name of the script.

Parameters:
scriptName The name of the script.
    public void setScriptName(String scriptName) {
        this. = scriptName;
    }
    
    
The name of the script.

Returns a reference to this object so that method calls can be chained together.

Parameters:
scriptName The name of the script.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Diagnostics withScriptName(String scriptName) {
        this. = scriptName;
        return this;
    }

    
The message associated with the error.

Returns:
The message associated with the error.
    public String getMessage() {
        return ;
    }
    
    
The message associated with the error.

Parameters:
message The message associated with the error.
    public void setMessage(String message) {
        this. = message;
    }
    
    
The message associated with the error.

Returns a reference to this object so that method calls can be chained together.

Parameters:
message The message associated with the error.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Diagnostics withMessage(String message) {
        this. = message;
        return this;
    }

    
The last portion of the associated diagnostic log.

Returns:
The last portion of the associated diagnostic log.
    public String getLogTail() {
        return ;
    }
    
    
The last portion of the associated diagnostic log.

Parameters:
logTail The last portion of the associated diagnostic log.
    public void setLogTail(String logTail) {
        this. = logTail;
    }
    
    
The last portion of the associated diagnostic log.

Returns a reference to this object so that method calls can be chained together.

Parameters:
logTail The last portion of the associated diagnostic log.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Diagnostics withLogTail(String logTail) {
        this. = logTail;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getErrorCode() != nullsb.append("ErrorCode: " + getErrorCode() + ",");
        if (getScriptName() != nullsb.append("ScriptName: " + getScriptName() + ",");
        if (getMessage() != nullsb.append("Message: " + getMessage() + ",");
        if (getLogTail() != nullsb.append("LogTail: " + getLogTail() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getErrorCode() == null) ? 0 : getErrorCode().hashCode()); 
        hashCode = prime * hashCode + ((getScriptName() == null) ? 0 : getScriptName().hashCode()); 
        hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); 
        hashCode = prime * hashCode + ((getLogTail() == null) ? 0 : getLogTail().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Diagnostics == falsereturn false;
        Diagnostics other = (Diagnostics)obj;
        
        if (other.getErrorCode() == null ^ this.getErrorCode() == nullreturn false;
        if (other.getErrorCode() != null && other.getErrorCode().equals(this.getErrorCode()) == falsereturn false
        if (other.getScriptName() == null ^ this.getScriptName() == nullreturn false;
        if (other.getScriptName() != null && other.getScriptName().equals(this.getScriptName()) == falsereturn false
        if (other.getMessage() == null ^ this.getMessage() == nullreturn false;
        if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == falsereturn false
        if (other.getLogTail() == null ^ this.getLogTail() == nullreturn false;
        if (other.getLogTail() != null && other.getLogTail().equals(this.getLogTail()) == falsereturn false
        return true;
    }
    
    @Override
    public Diagnostics clone() {
        try {
            return (Diagnosticssuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X