hudson.model.Run.getTime()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中hudson.model.Run.getTime方法的一些代码示例,展示了Run.getTime的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Run.getTime方法的具体详情如下:
包路径:hudson.model.Run
类名称:Run
方法名:getTime

Run.getTime介绍

[英]Same as #getTimestamp() but in a different type.
[中]与#getTimestamp()相同,但类型不同。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Returns the build time stamp in the body.
 */
public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException {
  rsp.setContentType("text/plain");
  rsp.setCharacterEncoding("US-ASCII");
  rsp.setStatus(HttpServletResponse.SC_OK);
  DateFormat df = format==null ?
      DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT, Locale.ENGLISH) :
      new SimpleDateFormat(format,req.getLocale());
  rsp.getWriter().print(df.format(getTime()));
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Returns the build time stamp in the body.
 */
public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException {
  rsp.setContentType("text/plain");
  rsp.setCharacterEncoding("US-ASCII");
  rsp.setStatus(HttpServletResponse.SC_OK);
  DateFormat df = format==null ?
      DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT, Locale.ENGLISH) :
      new SimpleDateFormat(format,req.getLocale());
  rsp.getWriter().print(df.format(getTime()));
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Returns the build time stamp in the body.
 */
public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException {
  rsp.setContentType("text/plain");
  rsp.setCharacterEncoding("US-ASCII");
  rsp.setStatus(HttpServletResponse.SC_OK);
  DateFormat df = format==null ?
      DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT, Locale.ENGLISH) :
      new SimpleDateFormat(format,req.getLocale());
  rsp.getWriter().print(df.format(getTime()));
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Returns the build time stamp in the body.
 */
public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException {
  rsp.setContentType("text/plain");
  rsp.setCharacterEncoding("US-ASCII");
  rsp.setStatus(HttpServletResponse.SC_OK);
  DateFormat df = format==null ?
      DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT, Locale.ENGLISH) :
      new SimpleDateFormat(format,req.getLocale());
  rsp.getWriter().print(df.format(getTime()));
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Returns the build time stamp in the body.
 */
public void doBuildTimestamp(StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException {
  rsp.setContentType("text/plain");
  rsp.setCharacterEncoding("US-ASCII");
  rsp.setStatus(HttpServletResponse.SC_OK);
  DateFormat df = format == null
      ? DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.ENGLISH)
      : new SimpleDateFormat(format, req.getLocale());
  rsp.getWriter().print(df.format(getTime()));
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Returns the build time stamp in the body.
 */
public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException {
  rsp.setContentType("text/plain");
  rsp.setCharacterEncoding("US-ASCII");
  rsp.setStatus(HttpServletResponse.SC_OK);
  DateFormat df = format==null ?
      DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT, Locale.ENGLISH) :
      new SimpleDateFormat(format,req.getLocale());
  rsp.getWriter().print(df.format(getTime()));
}

代码示例来源:origin: stackoverflow.com

public class Run implements Comparable<Run> {
 private int level;
 private int moves;
 private int time;
}
public class RunComparator implements Comparator<Run>{
 public int compare(Run o1, Run o2) {
  if(o1.getLevel() == o2.getLevel()){
   if(o1.getMoves() == o2.getMoves()){
    return o1.getTime() - o2.getTime();
   } 
   return o1.getMoves() - o2.getMoves();
  }
  return o1.getLevel() - o2.getLevel();
}

代码示例来源:origin: hudson/hudson-2.x

public TimelineEventList doData(StaplerRequest req, @QueryParameter long min, @QueryParameter long max) throws IOException {
  TimelineEventList result = new TimelineEventList();
  for (Run r : builds.byTimestamp(min, max)) {
    Event e = new Event();
    e.start = r.getTime();
    e.end = new Date(r.timestamp + r.getDuration());
    e.title = r.getFullDisplayName();
    // what to put in the description?
    // e.description = "Longish description of event "+r.getFullDisplayName();
    // e.durationEvent = true;
    e.link = req.getContextPath() + '/' + r.getUrl();
    BallColor c = r.getIconColor();
    e.color = String.format("#%06X", c.getBaseColor().darker().getRGB() & 0xFFFFFF);
    e.classname = "event-" + c.noAnime().toString() + " " + (c.isAnimated() ? "animated" : "");
    result.add(e);
  }
  return result;
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

public TimelineEventList doData(StaplerRequest req, @QueryParameter long min, @QueryParameter long max) throws IOException {
  TimelineEventList result = new TimelineEventList();
  for (Run r : builds.byTimestamp(min, max)) {
    Event e = new Event();
    e.start = r.getTime();
    e.end = new Date(r.timestamp + r.getDuration());
    e.title = r.getFullDisplayName();
    // what to put in the description?
    // e.description = "Longish description of event "+r.getFullDisplayName();
    // e.durationEvent = true;
    e.link = req.getContextPath() + '/' + r.getUrl();
    BallColor c = r.getIconColor();
    e.color = String.format("#%06X", c.getBaseColor().darker().getRGB() & 0xFFFFFF);
    e.classname = "event-" + c.noAnime().toString() + " " + (c.isAnimated() ? "animated" : "");
    result.add(e);
  }
  return result;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public TimelineEventList doData(StaplerRequest req, @QueryParameter long min, @QueryParameter long max) throws IOException {
  TimelineEventList result = new TimelineEventList();
  for (Run r : builds.byTimestamp(min, max)) {
    Event e = new Event();
    e.start = r.getTime();
    e.end = new Date(r.timestamp + r.getDuration());
    e.title = r.getFullDisplayName();
    // what to put in the description?
    // e.description = "Longish description of event "+r.getFullDisplayName();
    // e.durationEvent = true;
    e.link = req.getContextPath() + '/' + r.getUrl();
    BallColor c = r.getIconColor();
    e.color = String.format("#%06X", c.getBaseColor().darker().getRGB() & 0xFFFFFF);
    e.classname = "event-" + c.noAnime().toString() + " " + (c.isAnimated() ? "animated" : "");
    result.add(e);
  }
  return result;
}

代码示例来源:origin: jenkinsci/jobConfigHistory-plugin

Run<?, ?> previousBuild = lastBuild.getPreviousBuild();
if(previousBuild != null)
  lastBuildDate = previousBuild.getTime();

代码示例来源:origin: jenkinsci/build-failure-analyzer-plugin

int buildNumber = build.getNumber();
String displayName = build.getDisplayName();
Date startingTime = build.getTime();
long duration = build.getDuration();
List<String> triggerCauses = new LinkedList<String>();

相关文章

微信公众号

最新文章

更多

Run类方法