本文整理汇总了Java中jetbrains.buildServer.util.StringUtil.isNumber方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.isNumber方法的具体用法?Java StringUtil.isNumber怎么用?Java StringUtil.isNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jetbrains.buildServer.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.isNumber方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
private ActionErrors validate(@NotNull TelegramSettingsBean settings) {
ActionErrors errors = new ActionErrors();
if (StringUtil.isEmptyOrSpaces(settings.getBotToken())) {
errors.addError("emptyBotToken", "Bot token must not be empty");
}
if (settings.isUseProxy()) {
if (StringUtils.isEmpty(settings.getProxyServer())) {
errors.addError("emptyProxyServer", "Proxy server must not be empty");
}
if (StringUtils.isEmpty(settings.getProxyPort())) {
errors.addError("emptyProxyPort", "Proxy port must not be empty");
}
}
String port = settings.getProxyPort();
if (!StringUtils.isEmpty(port) &&
(!StringUtil.isNumber(port) || Integer.valueOf(port) < 1 || Integer.valueOf(port) > 65535)) {
errors.addError("badProxyPort", "Proxy port must be integer between 1 and 65535");
}
return errors;
}
示例2: getBranchName
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
private String getBranchName(PullRequest pr, String prNum) throws RunBuildException{
if(!StringUtil.isNumber(prNum)) {
return prNum;
}
try {
return pr != null? pr.getHead().getRef(): prNum;
}catch (Exception ex){
throw new RunBuildException("Unable to get branch name for pull request " + ex.getMessage(), ex);
}
}
示例3: getTriggerPropertiesProcessor
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
@Override
public PropertiesProcessor getTriggerPropertiesProcessor() {
return new PropertiesProcessor() {
public Collection<InvalidProperty> process(Map<String, String> properties) {
final ArrayList<InvalidProperty> invalidProps = new ArrayList<InvalidProperty>();
final String triggerBuildId = properties.get(DelayedBuildFinishTriggerConstants.TRIGGER_CONFIGURATION_PROPERTY);
if (StringUtil.isEmptyOrSpaces(triggerBuildId)) {
invalidProps.add(new InvalidProperty(DelayedBuildFinishTriggerConstants.TRIGGER_CONFIGURATION_PROPERTY, "Trigger Build must be specified"));
}
final SBuildType build = getDependentBuild(properties.get(DelayedBuildFinishTriggerConstants.TRIGGER_CONFIGURATION_PROPERTY));
if (build == null) {
invalidProps.add(new InvalidProperty(DelayedBuildFinishTriggerConstants.TRIGGER_CONFIGURATION_PROPERTY, "Trigger build must exist"));
}
final String waitTime = properties.get(DelayedBuildFinishTriggerConstants.WAIT_TIME_PROPERTY);
if (StringUtil.isEmptyOrSpaces(triggerBuildId)) {
invalidProps.add(new InvalidProperty(DelayedBuildFinishTriggerConstants.WAIT_TIME_PROPERTY, "Wait Time must be specified"));
}
if(!StringUtil.isNumber(properties.get(DelayedBuildFinishTriggerConstants.WAIT_TIME_PROPERTY))) {
invalidProps.add(new InvalidProperty(DelayedBuildFinishTriggerConstants.WAIT_TIME_PROPERTY, "Wait Time must be a number"));
}
return invalidProps;
}
};
}
开发者ID:rhysgodfrey,项目名称:team-city-delayed-finish-build-trigger,代码行数:29,代码来源:DelayedBuildFinishedTrigger.java