View Javadoc
1   package org.kuali.common.devops.jenkins.scan;
2   
3   import static org.kuali.common.devops.jenkins.scan.Jobs.getCalculatedDurationStatistics;
4   
5   import java.util.Comparator;
6   
7   // Singleton enum pattern
8   public enum JobTimeComparator implements Comparator<Job> {
9   	INSTANCE;
10  
11  	@Override
12  	public int compare(Job one, Job two) {
13  		double time1 = getCalculatedDurationStatistics(one).getSummary().getSum();
14  		double time2 = getCalculatedDurationStatistics(two).getSummary().getSum();
15  		return Double.compare(time1, time2);
16  	}
17  
18  }