本文整理了Java中io.fabric8.utils.Strings.notEmpty()
方法的一些代码示例,展示了Strings.notEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Strings.notEmpty()
方法的具体详情如下:
包路径:io.fabric8.utils.Strings
类名称:Strings
方法名:notEmpty
[英]Returns true if the given text is not null and not empty
[中]
代码示例来源:origin: io.fabric8/fabric-utils
/**
* Returns the first string value which is not null and not blank
*/
public static String firstNonBlank(String... values) {
for (String value : values) {
if (notEmpty(value)) {
return value;
}
}
return null;
}
代码示例来源:origin: io.fabric8/fabric-utils
public static String defaultIfEmpty(String value, String defaultValue) {
return notEmpty(value) ? value : defaultValue;
}
代码示例来源:origin: io.fabric8.updatebot/updatebot-core
protected static void logOutput(String output, boolean error) {
if (Strings.notEmpty(output)) {
String[] lines = output.split("\n");
for (String line : lines) {
if (error) {
LOG.error(line);
} else {
LOG.info(line);
}
}
}
}
代码示例来源:origin: io.jenkins.updatebot/updatebot-core
protected static void logOutput(String output, boolean error) {
if (Strings.notEmpty(output)) {
String[] lines = output.split("\n");
for (String line : lines) {
if (error) {
LOG.error(line);
} else {
LOG.info(line);
}
}
}
}
代码示例来源:origin: io.jenkins.updatebot/updatebot-core
/**
* Returns the repository string split its organisation and name
*/
public static GitRepositoryInfo parseRepository(String orgAndRepoName, String host) {
if (Strings.notEmpty(orgAndRepoName)) {
String[] paths = orgAndRepoName.split("/", 2);
if (paths.length > 1) {
return new GitRepositoryInfo(host, paths[0], paths[1]);
}
}
return null;
}
代码示例来源:origin: io.fabric8.updatebot/updatebot-core
/**
* Returns true if the given directory has modified files
*/
static boolean hasChangedFiles(File dir) {
try {
String output = ProcessHelper.runCommandCaptureOutput(dir, "git", "status", "-s");
if (output != null) {
output = output.trim();
}
return Strings.notEmpty(output);
} catch (IOException e) {
return false;
}
}
代码示例来源:origin: io.jenkins.updatebot/updatebot-core
/**
* Returns true if the given directory has modified files
*/
static boolean hasChangedFiles(File dir) {
try {
String output = ProcessHelper.runCommandCaptureOutput(dir, "git", "status", "-s");
if (output != null) {
output = output.trim();
}
return Strings.notEmpty(output);
} catch (IOException e) {
return false;
}
}
代码示例来源:origin: io.fabric8.updatebot/updatebot-core
protected static void logOutput(Configuration configuration, Logger log, String output, boolean error) {
if (Strings.notEmpty(output)) {
String[] lines = output.split("\n");
for (String line : lines) {
if (error) {
configuration.error(log, line);
} else {
configuration.info(log, line);
}
}
}
}
代码示例来源:origin: io.jenkins.updatebot/updatebot-core
protected static void logOutput(Configuration configuration, Logger log, String output, boolean error) {
if (Strings.notEmpty(output)) {
String[] lines = output.split("\n");
for (String line : lines) {
if (error) {
configuration.error(log, line);
} else {
configuration.info(log, line);
}
}
}
}
代码示例来源:origin: io.jenkins.updatebot/updatebot-core
String user = values[0];
String password = values[1];
if (Strings.notEmpty(user) && Strings.notEmpty(password)) {
map.put(host, new UserPassword(user, password));
count++;
代码示例来源:origin: io.fabric8.updatebot/updatebot-core
String path = url.getPath();
path = stripSlashesAndGit(path);
if (Strings.notEmpty(userInfo)) {
return new GitRepositoryInfo(host, userInfo, path);
} else {
if (Strings.notEmpty(path)) {
String[] paths = path.split("/", 2);
if (paths.length > 1) {
代码示例来源:origin: io.fabric8/gateway-core
LOG.debug("Selected service exposes the following URLS: {}", urlStrings);
for (String urlString : urlStrings) {
if (Strings.notEmpty(urlString)) {
代码示例来源:origin: io.jenkins.updatebot/updatebot-core
String path = url.getPath();
path = stripSlashesAndGit(path);
if (Strings.notEmpty(userInfo)) {
return new GitRepositoryInfo(host, userInfo, path);
} else {
代码示例来源:origin: io.fabric8/gateway-core
List<String> urlStrings = serviceDetails.getServices();
for (String urlString : urlStrings) {
if (Strings.notEmpty(urlString)) {
代码示例来源:origin: fabric8io/jube
protected static void createContainer(ProcessManager processManager, KubernetesModel model, Container container, Pod pod, PodStatus currentState) throws Exception {
String containerName = container.getName();
String image = container.getImage();
Strings.notEmpty(image);
OpenMavenURL mavenUrl = ImageMavenCoords.dockerImageToMavenURL(image);
Objects.notNull(mavenUrl, "mavenUrl");
内容来源于网络,如有侵权,请联系作者删除!