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

Method emptyToNull

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

Returns the given string if it is nonempty; null otherwise. @param string the string to test and possibly return @return string itself if it is nonempty; null if it is empty or null

(@Nullable String string)

Source from the content-addressed store, hash-verified

49 * @return {@code string} itself if it is nonempty; {@code null} if it is empty or null
50 */
51 @Nullable
52 public static String emptyToNull(@Nullable String string) {
53 return isNullOrEmpty(string) ? null : string;
54 }
55
56 /**
57 * Returns {@code true} if the given string is null or is the empty string.

Callers

nothing calls this directly

Calls 1

isNullOrEmptyMethod · 0.95

Tested by

no test coverage detected