aboutsummaryrefslogtreecommitdiff
path: root/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Platform.native.js
blob: cc9482e9ca18ee07a016210b09592200543f5c81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
 * @param {?string} str
 * @return {boolean} Whether the given string is null or is the empty string.
 * @public
 */
Platform.stringIsNullOrEmpty = function(str) {
  return !str;
};


/**
 * @param {?string} str
 * @return {string} Original str, if it is non-null. Otherwise empty string.
 */
Platform.nullToEmpty = function(str) {
  return str || "";
};


/**
 * @param {?string} str
 * @return {string} Original str, if it is non-empty. Otherwise null;
 */
Platform.emptyToNull = function(str) {
  return str || null;
};