All Downloads are FREE. Search and download functionalities are using the official Maven repository.

website.automate.waml.report.io.model.ExecutionStatus Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package website.automate.waml.report.io.model;

import static java.util.Arrays.asList;

import java.util.List;

public enum ExecutionStatus {
    SUCCESS,
    FAILURE,
    ERROR;
    
    private static List STATUS_SEVERITY_ORDER = asList(SUCCESS, FAILURE, ERROR);

    public static ExecutionStatus worstOf(ExecutionStatus left, ExecutionStatus right){
        int leftIndex = STATUS_SEVERITY_ORDER.indexOf(left);
        int rightIndex = STATUS_SEVERITY_ORDER.indexOf(right);
        
        int index = Math.max(leftIndex, rightIndex);
        return STATUS_SEVERITY_ORDER.get(index);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy