plc/gstats/GStatsBuildAction.java

public class GStatsBuildAction implements Action
{
  private final AbstractBuild<?, ?> build_;
  private final Map<String, String> results_;
  
  public GStatsBuildAction(final AbstractBuild<?, ?> build, 
                           final Map<String, String> results)
  {
    build_ = build;
    results_ = results;
  } // GStatsBuildAction

  public AbstractBuild<?, ?> getBuild() { return build_; }
  public Set<String> getResultNames() { return results_.keySet(); }
  public long getResultValue(final String name) { return Long.parseLong(results_.get(name)); }

  public String getDisplayName() { return "GStats"; }
  public String getIconFileName() { return "/plugin/bigredbutton/gstats.png"; }
  public String getUrlName() { return "gstats"; } 
    
So here's the BuildAction, with our little result structure. In this case it's a map, but a POJO or what would be fine. All it does is hang on to it. Recall how the stapler works. All the work happens in the matching index.jelly