public static String emptyToNull(String s){
  if (s == null)   return null;
  return s.length() == 0 ? null : s;
}

public static String emptyToNull ( String s ) { if ( s == null ) return null ; return s . length ( ) == 0 ? null : s ; }
converts a 0 - length string to null , leaves the string as is otherwise .
