code: private static String cleanString(String s) {
  		if (s != null) {
  			s = s.trim();
  			if (s.equals("")) {
  				s = null;
  			}
  		}
  		return s;
  	}
docs: Remove space at both ends and convert empty strings to null.