Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fcbfcdc authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

transform models/ProcessMould.java into models/Process.java

parent d7890dae
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -18,50 +18,41 @@ package ecorp.easy.installer.models;

import ecorp.easy.installer.models.steps.IStep;
import java.util.HashMap;
import java.util.Map;


/**
 * This class encapsulate the tree of steps to flash a device
 * Could be name: StepTree or StepMap or FlashingProcess
 * @author Vincent Bourgmayer
 */
public class ProcessMould {
public class Process {

    String modelName; 
    Map<String, IStep> steps;
    private final int stepCount; //Number of step to consider
    private HashMap<String, IStep> steps; //Map of steps to follow

    /**
     * Constructor of ProcessMould
     * Create an empty list of steps
     * @param modelName the name of the model
     * @param stepCount int number of step used for FlashProcess
     */
    public ProcessMould(String modelName){
        this.modelName = modelName;
    public Process(int stepCount){
        this.stepCount = stepCount;
        this.steps = new HashMap<>();
    }
    
    /**
     * Add a step object
     * @param key
     * @param step 
     */
    public void addStep(String key, IStep step){
        this.steps.put(key, step);
    }
    
    /**
     * Get the name of the phone's model
     * @return 
     */
    public String getModelName() {
        return modelName;
    public int getStepCount() {
        return stepCount;
    }

    /**
     * Get the list of steps in this processMould
     * @return 
     */
    public Map<String, IStep> getSteps() {
    public HashMap<String, IStep> getSteps() {
        return steps;
    }

@@ -69,7 +60,16 @@ public class ProcessMould {
     * Replace current steps by the new one
     * @param steps the new steps
     */
    public void setSteps(Map<String, IStep> steps) {
    public void setSteps(HashMap<String, IStep> steps) {
        this.steps = steps;
    }
    
    /**
     * Add a step object
     * @param key
     * @param step 
     */
    public void addStep(String key, IStep step){
        this.steps.put(key, step);
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package ecorp.easy.installer.threads;
import ecorp.easy.installer.AppConstants;
import ecorp.easy.installer.models.Phone;
import ecorp.easy.installer.models.ProcessMould;
import ecorp.easy.installer.models.Process;
import ecorp.easy.installer.models.steps.IStep;
import ecorp.easy.installer.utils.ConfigParser;
import java.io.IOException;
@@ -40,7 +40,7 @@ import org.yaml.snakeyaml.Yaml;
 */
public class ThreadFactory {
    private final static Logger logger = LoggerFactory.getLogger(ThreadFactory.class);
    private ProcessMould flashMould;
    private Process flashMould;
    private final HashMap<String, String> sourcesToDownload;
    private Phone device;
    private final String yamlFolderPath;
@@ -91,7 +91,7 @@ public class ThreadFactory {
                return false;
            }
        
            flashMould = new ProcessMould(modelName);
            flashMould = new Process(modelName);
            
            loadFlashProcess((Map) yamlContent.get("steps"));

@@ -180,7 +180,7 @@ public class ThreadFactory {
    }
    
    
    public ProcessMould getFlashMould() {
    public Process getFlashMould() {
        return flashMould;
    }
}
 No newline at end of file