/*
 * Copyright (c) 2016 eilslabs.
 *
 * Distributed under the MIT License (license terms are at https://www.github.com/eilslabs/Roddy/LICENSE.txt).
 */

package de.dkfz.roddy.execution.io;

import de.dkfz.roddy.core.InfoObject;

import java.util.List;

/**
 * Stores the result of a command execution.
 * Commands can i.e. be executed via ssh or on the local command line.
 * @author michael
 */
public class ExecutionResult extends ExecutionHelper.ExtendedProcessExecutionResult {

    /**
     * Successful or not?
     */
    public final boolean successful;
    /**
     * An error number. Normally the return code for shell stuff.
     */
    @Deprecated
    public final int errorNumber;
    /**
     * All result lines.
     */
    public final List<String> resultLines;
    /**
     * First line of the result array.
     * Null if no entries are in the array.
     */
    public final String firstLine;

    public final int exitCode;

    public ExecutionResult(boolean successful, int exitCode, List<String> resultLines, String processID) {
        super(exitCode, processID, resultLines);
        this.successful = successful;
        this.errorNumber = exitCode;
        this.exitCode = exitCode;
        this.resultLines = resultLines;
//        this.processID = processID;
        if(resultLines.size() > 0)
            firstLine = resultLines.get(0);
        else
            firstLine = null;
    }

    @Override
    public boolean isSuccessful() {
        return exitCode == 0;
    }

    public boolean getSuccessful() {
        return isSuccessful();
    }
}

@@ -431,267 +431,210 @@
 nds 
-ExecutionHelper.ExtendedProcessExecutionResult %7B%0A%0A    /**%0A     * Successful or not?%0A     */%0A    public final boolean successful;%0A    /**%0A     * An error number. Normally the return code for shell stuff.%0A     */%0A    @Deprecated%0A    public final int errorNumber
+InfoObject %7B%0A%0A    /**%0A     * This can hold some sort of process id for a process%0A     */%0A    public final String processID;%0A%0A    /**%0A     * Successful or not?%0A     */%0A    public final boolean successful
 ;%0A  
@@ -989,24 +989,25 @@
 ssID) %7B%0A
+%0A
         
 super(ex
@@ -1002,47 +1002,34 @@
     
-super(exitCode, processID, resultLines)
+this.processID = processID
 ;%0A  
@@ -1068,45 +1068,8 @@
 ul;%0A
-        this.errorNumber = exitCode;%0A
     
@@ -1142,46 +1142,8 @@
 es;%0A
-//        this.processID = processID;%0A
     
@@ -1271,22 +1271,8 @@
  %7D%0A%0A
-    @Override%0A
     
@@ -1413,11 +1413,81 @@
 );%0A    %7D
+%0A%0A    @Deprecated%0A    public int getErrorNumber() %7B return exitCode; %7D
 %0A%7D%0A

Remove deprecated class