hudson.Util.tryParseNumber()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(159)

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

Util.tryParseNumber介绍

[英]Returns the parsed string if parsed successful; otherwise returns the default number. If the string is null, empty or a ParseException is thrown then the defaultNumber is returned.
[中]如果解析成功,返回解析后的字符串;否则返回默认数字。如果字符串为null、为空或引发ParseException,则返回defaultNumber。

代码示例

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

public Slave(String name, String nodeDescription, String remoteFS, String numExecutors,
       Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
  this(name,nodeDescription,remoteFS,Util.tryParseNumber(numExecutors, 1).intValue(),mode,labelString,launcher,retentionStrategy, nodeProperties);
}

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

public Slave(String name, String nodeDescription, String remoteFS, String numExecutors,
       Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
  this(name,nodeDescription,remoteFS,Util.tryParseNumber(numExecutors, 1).intValue(),mode,labelString,launcher,retentionStrategy, nodeProperties);
}

代码示例来源:origin: Netflix-Skunkworks/dynaslave-plugin

@DataBoundConstructor
public DynaSlave(String name, String nodeDescription, String remoteFS, String numExecutors, Mode mode,
         String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy,
         List<? extends NodeProperty<?>> nodeProperties)
    throws FormException, IOException {
  super(name, nodeDescription, remoteFS, Util.tryParseNumber(numExecutors, 1).intValue(), mode, labelString,
      launcher, retentionStrategy, nodeProperties);
}

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

@DataBoundConstructor
public Slave(String name, String nodeDescription, String remoteFS, String numExecutors,
       Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
  this(name,nodeDescription,remoteFS,Util.tryParseNumber(numExecutors, 1).intValue(),mode,labelString,launcher,retentionStrategy, nodeProperties);
}

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

@DataBoundConstructor
public Slave(String name, String nodeDescription, String remoteFS, String numExecutors,
    Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
  this(name, nodeDescription, remoteFS, Util.tryParseNumber(numExecutors, 1).intValue(), mode, labelString, launcher, retentionStrategy, nodeProperties);
}

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

@DataBoundConstructor
public Slave(String name, String nodeDescription, String remoteFS, String numExecutors,
       Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
  this(name,nodeDescription,remoteFS,Util.tryParseNumber(numExecutors, 1).intValue(),mode,labelString,launcher,retentionStrategy, nodeProperties);
}

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

@DataBoundConstructor
@SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
public SwarmSlave(String name, String nodeDescription, String remoteFS, String numExecutors, Mode mode,
         String labelString, ComputerLauncher launcher, RetentionStrategy<?> retentionStrategy,
         List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
  super(name, nodeDescription, remoteFS, Util.tryParseNumber(numExecutors, 1).intValue(), mode, labelString,
      launcher, retentionStrategy, nodeProperties);
}

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

@DataBoundConstructor
public Slave(String name, String nodeDescription, String remoteFS, String numExecutors,
       Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
  this(name,nodeDescription,remoteFS,Util.tryParseNumber(numExecutors, 1).intValue(),mode,labelString,launcher,retentionStrategy, nodeProperties);
}

代码示例来源:origin: Netflix-Skunkworks/dynaslave-plugin

@DataBoundConstructor
public DynaSlaveRetentionStrategy(String strIdleMinutes) {
  this.idleMinutes.set(Util.tryParseNumber(strIdleMinutes, 30).intValue());
}

相关文章

微信公众号

最新文章

更多