website.automate.waml.report.io.model.ExecutionStatus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of waml-report-io Show documentation
Show all versions of waml-report-io Show documentation
(De)Serializer of the web automation markup language (WAML) reports for Java
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);
}
}