예제 #1
0
파일: Job.java 프로젝트: neo2buha/jenkins
  /** Returns the last build. */
  @Exported
  @QuickSilver
  public RunT getLastBuild() {
    SortedMap<Integer, ? extends RunT> runs = _getRuns();

    if (runs.isEmpty()) return null;
    return runs.get(runs.firstKey());
  }
예제 #2
0
파일: Job.java 프로젝트: neo2buha/jenkins
 /**
  * Gets the latest build #m that satisfies <tt>m&lt;=n</tt>.
  *
  * <p>This is useful when you'd like to fetch a build but the exact build might be already gone
  * (deleted, rotated, etc.)
  */
 public final RunT getNearestOldBuild(int n) {
   SortedMap<Integer, ? extends RunT> m = _getRuns().tailMap(n);
   if (m.isEmpty()) return null;
   return m.get(m.firstKey());
 }