org.crsh.util.Utils.join()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(131)

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

Utils.join介绍

暂无

代码示例

代码示例来源:origin: crashub/crash

private CRaSHTaskDef validateAndParseCronLine(String cronLine) {

  //
  cronLine = cronLine.trim();
  if (cronLine.length() == 0 || cronLine.charAt(0) == '#') {
   return null;
  }

  //
  List<String> cronLineParts = Arrays.asList(cronLine.split("\\s+"));
  if (cronLineParts.size() < 6) {
   return null;
  }

  //
  String schedulePart = Utils.join(cronLineParts.subList(0, 5), " ");
  String commandPart = Utils.join(cronLineParts.subList(5, cronLineParts.size()), " ");

  try {
   return new CRaSHTaskDef(new SchedulingPattern(schedulePart), commandPart);
  }
  catch (InvalidPatternException e) {
   // ?
   return null;
  }
 }
}

代码示例来源:origin: crashub/crash

public void assertRender(LineReader renderer, int width, String... expected) {
  List<String> result = render(renderer, width);
  if (result.size() != expected.length) {
   throw failure("Was expecting the same number of lines got:" + Utils.join(result, "/") + " expected:" +
     Utils.join(Arrays.asList(expected), "/"));
  } else {
   for (int i = 0;i < expected.length;i++) {
    if (!result.get(i).equals(expected[i])) {
     throw failure("Was expecting line " + i + " <" + result.get(i) + "> to be equals to <" + expected[i] + ">");
    }
   }
  }
 }
}

代码示例来源:origin: crashub/crash

final InternetAddress[] addresses = InternetAddress.parse(Utils.join(recipients, ","));

代码示例来源:origin: org.crashub/crash.plugins.mail

final InternetAddress[] addresses = InternetAddress.parse(Utils.join(recipients, ","));

相关文章