code: protected String nullIfEmpty(String str) {
          return (str == null || str.trim().length() == 0) ? null : str;
      }
docs: Return null if the given string is null or an empty string.
  
  @param str a string.
  @return null or the string.