File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
android/guava/src/com/google/common/base
guava/src/com/google/common/base Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,22 @@ static boolean stringIsNullOrEmpty(@NullableDecl String string) {
58
58
return string == null || string .isEmpty ();
59
59
}
60
60
61
+ /**
62
+ * Returns the string if it is not null, or an empty string otherwise.
63
+ *
64
+ * @param string the string to test and possibly return
65
+ * @return {@code string} if it is not null; {@code ""} otherwise
66
+ */
61
67
static String nullToEmpty (@ NullableDecl String string ) {
62
68
return (string == null ) ? "" : string ;
63
69
}
64
70
71
+ /**
72
+ * Returns the string if it is not empty, or a null string otherwise.
73
+ *
74
+ * @param string the string to test and possibly return
75
+ * @return {@code string} if it is not empty; {@code null} otherwise
76
+ */
65
77
static String emptyToNull (@ NullableDecl String string ) {
66
78
return stringIsNullOrEmpty (string ) ? null : string ;
67
79
}
Original file line number Diff line number Diff line change @@ -58,10 +58,22 @@ static boolean stringIsNullOrEmpty(@Nullable String string) {
58
58
return string == null || string .isEmpty ();
59
59
}
60
60
61
+ /**
62
+ * Returns the string if it is not null, or an empty string otherwise.
63
+ *
64
+ * @param string the string to test and possibly return
65
+ * @return {@code string} if it is not null; {@code ""} otherwise
66
+ */
61
67
static String nullToEmpty (@ Nullable String string ) {
62
68
return (string == null ) ? "" : string ;
63
69
}
64
70
71
+ /**
72
+ * Returns the string if it is not empty, or a null string otherwise.
73
+ *
74
+ * @param string the string to test and possibly return
75
+ * @return {@code string} if it is not empty; {@code null} otherwise
76
+ */
65
77
static String emptyToNull (@ Nullable String string ) {
66
78
return stringIsNullOrEmpty (string ) ? null : string ;
67
79
}
You can’t perform that action at this time.
0 commit comments