MCPcopy Create free account
hub / github.com/antlr/codebuff / isNullOrEmpty

Method isNullOrEmpty

corpus/java/training/guava/base/Strings.java:67–69  ·  view source on GitHub ↗

Returns true if the given string is null or is the empty string. Consider normalizing your string references with #nullToEmpty. If you do, you can use String#isEmpty() instead of this method, and you won't need special null-safe forms of methods like {@link String#toUpper

(@Nullable String string)

Source from the content-addressed store, hash-verified

65 * @return {@code true} if the string is null or is the empty string
66 */
67 public static boolean isNullOrEmpty(@Nullable String string) {
68 return string == null || string.isEmpty();
69 }
70
71 /**
72 * Returns a string, of length at least {@code minLength}, consisting of {@code string} prepended

Callers 2

emptyToNullMethod · 0.95
fromStringMethod · 0.95

Calls 1

isEmptyMethod · 0.65

Tested by

no test coverage detected