/** * Gets all the builds in a map. */ public SortedMap<Integer, RunT> getBuildsAsMap() { return Collections.<Integer, RunT>unmodifiableSortedMap(_getRuns()); }
/** * @param n * The build number. * @return null if no such build exists. * @see Run#getNumber() * @see LazyBuildMixIn#getBuildByNumber */ public RunT getBuildByNumber(int n) { return _getRuns().get(n); }
/** * Gets the latest build #m that satisfies {@code m<=n}. * * This is useful when you'd like to fetch a build but the exact build might * be already gone (deleted, rotated, etc.) * @see LazyBuildMixIn#getNearestOldBuild */ public RunT getNearestOldBuild(int n) { SortedMap<Integer, ? extends RunT> m = _getRuns().tailMap(n); if (m.isEmpty()) return null; return m.get(m.firstKey()); }
/** * Gets the youngest build #m that satisfies {@code n<=m}. * * This is useful when you'd like to fetch a build but the exact build might * be already gone (deleted, rotated, etc.) * @see LazyBuildMixIn#getNearestBuild */ public RunT getNearestBuild(int n) { SortedMap<Integer, ? extends RunT> m = _getRuns().headMap(n - 1); // the map should // include n, so n-1 if (m.isEmpty()) return null; return m.get(m.lastKey()); }
/** * Looks up a build by its ID. * @see LazyBuildMixIn#getBuild */ public RunT getBuild(String id) { for (RunT r : _getRuns().values()) { if (r.getId().equals(id)) return r; } return null; }
/** * Returns the last build. * @see LazyBuildMixIn#getLastBuild */ @Exported @QuickSilver public RunT getLastBuild() { SortedMap<Integer, ? extends RunT> runs = _getRuns(); if (runs.isEmpty()) return null; return runs.get(runs.firstKey()); }
/** * Returns the oldest build in the record. * @see LazyBuildMixIn#getFirstBuild */ @Exported @QuickSilver public RunT getFirstBuild() { SortedMap<Integer, ? extends RunT> runs = _getRuns(); if (runs.isEmpty()) return null; return runs.get(runs.lastKey()); }
/** * Gets the read-only view of all the builds. * * @return never null. The first entry is the latest build. */ @Exported(name="allBuilds",visibility=-2) @WithBridgeMethods(List.class) public RunList<RunT> getBuilds() { return RunList.<RunT>fromRuns(_getRuns().values()); }
SortedMap<Integer, ? extends RunT> runs = _getRuns(); if (runs instanceof RunMap) { RunMap<RunT> runMap = (RunMap<RunT>) runs;
/** * Gets all the builds in a map. */ public SortedMap<Integer, RunT> getBuildsAsMap() { return Collections.<Integer, RunT>unmodifiableSortedMap(_getRuns()); }
/** * Gets all the builds in a map. */ public SortedMap<Integer, RunT> getBuildsAsMap() { return Collections.unmodifiableSortedMap(_getRuns()); }
/** * @param n * The build number. * @return null if no such build exists. * @see Run#getNumber() */ public RunT getBuildByNumber(int n) { return _getRuns().get(n); }
/** * @param n The build number. * @return null if no such build exists. * @see Run#getNumber() */ public RunT getBuildByNumber(int n) { return _getRuns().get(n); }
/** * Gets the youngest build #m that satisfies <tt>n<=m</tt>. * * 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 getNearestBuild(int n) { SortedMap<Integer, ? extends RunT> m = _getRuns().headMap(n - 1); // the map should // include n, so n-1 if (m.isEmpty()) return null; return m.get(m.lastKey()); }
/** * @deprecated since 2008-06-15. * This is only used to support backward compatibility with old URLs. */ @Deprecated public RunT getBuild(String id) { for (RunT r : _getRuns().values()) { if (r.getId().equals(id)) return r; } return null; }
/** * Returns the oldest build in the record. */ @Exported @QuickSilver public RunT getFirstBuild() { SortedMap<Integer, ? extends RunT> runs = _getRuns(); if (runs.isEmpty()) return null; return runs.get(runs.lastKey()); }
/** * 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()); }
/** * Gets the read-only view of all the builds. * * @return never null. The first entry is the latest build. */ @Exported @WithBridgeMethods(List.class) public RunList<RunT> getBuilds() { return RunList.fromRuns(_getRuns().values()); }
/** * Gets the read-only view of all the builds. * * @return never null. The first entry is the latest build. */ @Exported(name="allBuilds",visibility=-2) @WithBridgeMethods(List.class) public RunList<RunT> getBuilds() { return RunList.<RunT>fromRuns(_getRuns().values()); }
/** * Gets the read-only view of all the builds. * * @return never null. The first entry is the latest build. */ @Exported @WithBridgeMethods(List.class) public RunList<RunT> getBuilds() { return RunList.fromRuns(_getRuns().values()); }