class EmrHelper extends AwsHelper {

    public StepConfig getEmrHadoopJarStepConfig(String stepName, String jarLocation, String mainClass, List<String> scriptArguments, Boolean isContinueOnError)
    {
        // Default ActionOnFailure is to cancel the execution and wait
        ActionOnFailure actionOnFailure = ActionOnFailure.CANCEL_AND_WAIT;

        if (isContinueOnError != null && isContinueOnError)
        {
            // Override based on user input
            actionOnFailure = ActionOnFailure.CONTINUE;
        }

        // If there are no arguments
        if (CollectionUtils.isEmpty(scriptArguments))
        {
            // Build the StepConfig object and return
            return new StepConfig().withName(stepName.trim()).withActionOnFailure(actionOnFailure)
                .withHadoopJarStep(new HadoopJarStepConfig().withJar(jarLocation.trim()).withMainClass(mainClass));
        }
        else
        {
            // If there are arguments, include the arguments in the StepConfig object
            return new StepConfig().withName(stepName.trim()).withActionOnFailure(actionOnFailure).withHadoopJarStep(
                new HadoopJarStepConfig().withJar(jarLocation.trim()).withMainClass(mainClass)
                    .withArgs(scriptArguments.toArray(new String[scriptArguments.size()])));
        }
    }

}