hudson.model.EntryComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of radiatorviewplugin Show documentation
Show all versions of radiatorviewplugin Show documentation
Adds a new high visibility view of project status.
/*
* Copyright (c) 1Spatial Group Ltd.
*/
/**
*
*/
package hudson.model;
import java.util.Comparator;
final class EntryComparator implements Comparator
{
public int compare(ViewEntry o1, ViewEntry o2)
{
// first compare by status
Result r1 = RadiatorView.getResult(o1.getJob());
Result r2 = RadiatorView.getResult(o2.getJob());
if (r1 != null && r2 != null)
{
if (r1.isBetterThan(r2))
{
return 1;
}
else if (r1.isWorseThan(r2))
{
return -1;
}
}
// finally compare by name
return o1.getName().compareTo(o2.getName());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy