List of usage examples for org.apache.commons.lang3 StringUtils isAnyBlank
public static boolean isAnyBlank(final CharSequence... css)
Checks if any one of the CharSequences are blank ("") or null and not whitespace only..
StringUtils.isAnyBlank(null) = true StringUtils.isAnyBlank(null, "foo") = true StringUtils.isAnyBlank(null, null) = true StringUtils.isAnyBlank("", "bar") = true StringUtils.isAnyBlank("bob", "") = true StringUtils.isAnyBlank(" bob ", null) = true StringUtils.isAnyBlank(" ", "bar") = true StringUtils.isAnyBlank("foo", "bar") = false
From source file:com.qq.tars.service.SetTriple.java
public static SetTriple parseSet(String set) { Preconditions.checkArgument(null != set, "set is null"); String[] tokens = StringUtils.split(set, '.'); if (tokens.length != 3 || StringUtils.isAnyBlank(tokens)) { throw new IllegalArgumentException(String.format("set=%s", set)); }//from w w w. j av a2 s. c o m return SetTriple.formatSet(tokens[0], tokens[1], tokens[2]); }
From source file:io.fabric8.vertx.maven.plugin.utils.Prompter.java
public String prompt(String message, String defaultValue) { System.out.printf("%s (%s):", message, defaultValue); String input = StringUtils.chomp(scanner.nextLine()); if (StringUtils.isAnyBlank(input)) { return defaultValue; } else {// w ww. j a v a2 s . c o m return input; } }
From source file:net.csthings.cassinate.CassinateHelper.java
public static List<String> getQueries(String filename) throws IOException { File file = new File(filename); String query = ""; List<String> lines = FileUtils.readLines(file, Charset.forName("UTF-8")); List<String> queries = new ArrayList<>(); LOG.debug("Executing file: {}", filename); for (String line : lines) { if (!StringUtils.isAnyBlank(line)) { query = StringUtils.join(query, line); continue; }/*from www .j a v a2 s. c om*/ queries.add(query); query = ""; } if (!StringUtils.isAnyBlank(query)) queries.add(query); return queries; }