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.elasticmapreduce.model;
 

Specification of a job flow step.

 
 public class StepConfig implements SerializableCloneable {

    
The name of the job flow step.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String name;

    
The action to take if the job flow step fails.

Constraints:
Allowed Values: TERMINATE_JOB_FLOW, TERMINATE_CLUSTER, CANCEL_AND_WAIT, CONTINUE

 
     private String actionOnFailure;

    
The JAR file used for the job flow step.
 
     private HadoopJarStepConfig hadoopJarStep;

    
Default constructor for a new StepConfig object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public StepConfig() {}
    
    
Constructs a new StepConfig object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
name The name of the job flow step.
hadoopJarStep The JAR file used for the job flow step.
 
     public StepConfig(String nameHadoopJarStepConfig hadoopJarStep) {
         setName(name);
         setHadoopJarStep(hadoopJarStep);
     }

    
The name of the job flow step.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The name of the job flow step.
 
     public String getName() {
         return ;
     }
    
    
The name of the job flow step.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
name The name of the job flow step.
 
     public void setName(String name) {
         this. = name;
     }
    
    
The name of the job flow step.

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

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
name The name of the job flow step.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StepConfig withName(String name) {
        this. = name;
        return this;
    }

    
The action to take if the job flow step fails.

Constraints:
Allowed Values: TERMINATE_JOB_FLOW, TERMINATE_CLUSTER, CANCEL_AND_WAIT, CONTINUE

Returns:
The action to take if the job flow step fails.
See also:
ActionOnFailure
    public String getActionOnFailure() {
        return ;
    }
    
    
The action to take if the job flow step fails.

Constraints:
Allowed Values: TERMINATE_JOB_FLOW, TERMINATE_CLUSTER, CANCEL_AND_WAIT, CONTINUE

Parameters:
actionOnFailure The action to take if the job flow step fails.
See also:
ActionOnFailure
    public void setActionOnFailure(String actionOnFailure) {
        this. = actionOnFailure;
    }
    
    
The action to take if the job flow step fails.

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

Constraints:
Allowed Values: TERMINATE_JOB_FLOW, TERMINATE_CLUSTER, CANCEL_AND_WAIT, CONTINUE

Parameters:
actionOnFailure The action to take if the job flow step fails.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ActionOnFailure
    public StepConfig withActionOnFailure(String actionOnFailure) {
        this. = actionOnFailure;
        return this;
    }

    
The action to take if the job flow step fails.

Constraints:
Allowed Values: TERMINATE_JOB_FLOW, TERMINATE_CLUSTER, CANCEL_AND_WAIT, CONTINUE

Parameters:
actionOnFailure The action to take if the job flow step fails.
See also:
ActionOnFailure
    public void setActionOnFailure(ActionOnFailure actionOnFailure) {
        this. = actionOnFailure.toString();
    }
    
    
The action to take if the job flow step fails.

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

Constraints:
Allowed Values: TERMINATE_JOB_FLOW, TERMINATE_CLUSTER, CANCEL_AND_WAIT, CONTINUE

Parameters:
actionOnFailure The action to take if the job flow step fails.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ActionOnFailure
    public StepConfig withActionOnFailure(ActionOnFailure actionOnFailure) {
        this. = actionOnFailure.toString();
        return this;
    }

    
The JAR file used for the job flow step.

Returns:
The JAR file used for the job flow step.
        return ;
    }
    
    
The JAR file used for the job flow step.

Parameters:
hadoopJarStep The JAR file used for the job flow step.
    public void setHadoopJarStep(HadoopJarStepConfig hadoopJarStep) {
        this. = hadoopJarStep;
    }
    
    
The JAR file used for the job flow step.

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

Parameters:
hadoopJarStep The JAR file used for the job flow step.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StepConfig withHadoopJarStep(HadoopJarStepConfig hadoopJarStep) {
        this. = hadoopJarStep;
        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 (getName() != nullsb.append("Name: " + getName() + ",");
        if (getActionOnFailure() != nullsb.append("ActionOnFailure: " + getActionOnFailure() + ",");
        if (getHadoopJarStep() != nullsb.append("HadoopJarStep: " + getHadoopJarStep() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getActionOnFailure() == null) ? 0 : getActionOnFailure().hashCode()); 
        hashCode = prime * hashCode + ((getHadoopJarStep() == null) ? 0 : getHadoopJarStep().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof StepConfig == falsereturn false;
        StepConfig other = (StepConfig)obj;
        
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getActionOnFailure() == null ^ this.getActionOnFailure() == nullreturn false;
        if (other.getActionOnFailure() != null && other.getActionOnFailure().equals(this.getActionOnFailure()) == falsereturn false
        if (other.getHadoopJarStep() == null ^ this.getHadoopJarStep() == nullreturn false;
        if (other.getHadoopJarStep() != null && other.getHadoopJarStep().equals(this.getHadoopJarStep()) == falsereturn false
        return true;
    }
    
    @Override
    public StepConfig clone() {
        try {
            return (StepConfigsuper.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