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;
 

A job flow step consisting of a JAR file whose main function will be executed. The main function submits a job for Hadoop to execute and waits for the job to finish or fail.

 
 public class HadoopJarStepConfig implements SerializableCloneable {

    
A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function.
 
A path to a JAR file run during the step.

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

 
     private String jar;

    
The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file.

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

 
     private String mainClass;

    
A list of command line arguments passed to the JAR file's main function when executed.
 
Default constructor for a new HadoopJarStepConfig object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public HadoopJarStepConfig() {}
    
    
Constructs a new HadoopJarStepConfig object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
jar A path to a JAR file run during the step.
 
     public HadoopJarStepConfig(String jar) {
         setJar(jar);
     }

    
A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function.

Returns:
A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function.
 
     public java.util.List<KeyValuegetProperties() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<KeyValue>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function.

Parameters:
properties A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function.
 
     public void setProperties(java.util.Collection<KeyValueproperties) {
        if (properties == null) {
            this. = null;
            return;
        }
        propertiesCopy.addAll(properties);
        this. = propertiesCopy;
    }
    
    
A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function.

NOTE: This method appends the values to the existing list (if any). Use setProperties(java.util.Collection) or withProperties(java.util.Collection) if you want to override the existing values.

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

Parameters:
properties A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function.
Returns:
A reference to this updated object so that method calls can be chained together.
    public HadoopJarStepConfig withProperties(KeyValue... properties) {
        if (getProperties() == nullsetProperties(new java.util.ArrayList<KeyValue>(properties.length));
        for (KeyValue value : properties) {
            getProperties().add(value);
        }
        return this;
    }
    
    
A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function.

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

Parameters:
properties A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (properties == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<KeyValuepropertiesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<KeyValue>(properties.size());
            propertiesCopy.addAll(properties);
            this. = propertiesCopy;
        }
        return this;
    }

    
A path to a JAR file run during the step.

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

Returns:
A path to a JAR file run during the step.
    public String getJar() {
        return ;
    }
    
    
A path to a JAR file run during the step.

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

Parameters:
jar A path to a JAR file run during the step.
    public void setJar(String jar) {
        this. = jar;
    }
    
    
A path to a JAR file run during the step.

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

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

Parameters:
jar A path to a JAR file run during the step.
Returns:
A reference to this updated object so that method calls can be chained together.
    public HadoopJarStepConfig withJar(String jar) {
        this. = jar;
        return this;
    }

    
The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file.

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

Returns:
The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file.
    public String getMainClass() {
        return ;
    }
    
    
The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file.

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

Parameters:
mainClass The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file.
    public void setMainClass(String mainClass) {
        this. = mainClass;
    }
    
    
The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file.

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

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

Parameters:
mainClass The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file.
Returns:
A reference to this updated object so that method calls can be chained together.
    public HadoopJarStepConfig withMainClass(String mainClass) {
        this. = mainClass;
        return this;
    }

    
A list of command line arguments passed to the JAR file's main function when executed.

Returns:
A list of command line arguments passed to the JAR file's main function when executed.
    public java.util.List<StringgetArgs() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of command line arguments passed to the JAR file's main function when executed.

Parameters:
args A list of command line arguments passed to the JAR file's main function when executed.
    public void setArgs(java.util.Collection<Stringargs) {
        if (args == null) {
            this. = null;
            return;
        }
        argsCopy.addAll(args);
        this. = argsCopy;
    }
    
    
A list of command line arguments passed to the JAR file's main function when executed.

NOTE: This method appends the values to the existing list (if any). Use setArgs(java.util.Collection) or withArgs(java.util.Collection) if you want to override the existing values.

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

Parameters:
args A list of command line arguments passed to the JAR file's main function when executed.
Returns:
A reference to this updated object so that method calls can be chained together.
    public HadoopJarStepConfig withArgs(String... args) {
        if (getArgs() == nullsetArgs(new java.util.ArrayList<String>(args.length));
        for (String value : args) {
            getArgs().add(value);
        }
        return this;
    }
    
    
A list of command line arguments passed to the JAR file's main function when executed.

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

Parameters:
args A list of command line arguments passed to the JAR file's main function when executed.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (args == null) {
            this. = null;
        } else {
            argsCopy.addAll(args);
            this. = argsCopy;
        }
        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 (getProperties() != nullsb.append("Properties: " + getProperties() + ",");
        if (getJar() != nullsb.append("Jar: " + getJar() + ",");
        if (getMainClass() != nullsb.append("MainClass: " + getMainClass() + ",");
        if (getArgs() != nullsb.append("Args: " + getArgs() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getProperties() == null) ? 0 : getProperties().hashCode()); 
        hashCode = prime * hashCode + ((getJar() == null) ? 0 : getJar().hashCode()); 
        hashCode = prime * hashCode + ((getMainClass() == null) ? 0 : getMainClass().hashCode()); 
        hashCode = prime * hashCode + ((getArgs() == null) ? 0 : getArgs().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof HadoopJarStepConfig == falsereturn false;
        HadoopJarStepConfig other = (HadoopJarStepConfig)obj;
        
        if (other.getProperties() == null ^ this.getProperties() == nullreturn false;
        if (other.getProperties() != null && other.getProperties().equals(this.getProperties()) == falsereturn false
        if (other.getJar() == null ^ this.getJar() == nullreturn false;
        if (other.getJar() != null && other.getJar().equals(this.getJar()) == falsereturn false
        if (other.getMainClass() == null ^ this.getMainClass() == nullreturn false;
        if (other.getMainClass() != null && other.getMainClass().equals(this.getMainClass()) == falsereturn false
        if (other.getArgs() == null ^ this.getArgs() == nullreturn false;
        if (other.getArgs() != null && other.getArgs().equals(this.getArgs()) == falsereturn false
        return true;
    }
    
    @Override
    public HadoopJarStepConfig clone() {
        try {
            return (HadoopJarStepConfigsuper.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