Here you can find the source of emptyToNull(String str)
public static String emptyToNull(String str)
//package com.java2s; //License from project: Apache License public class Main { public static String emptyToNull(String str) { return isBlank(str) ? null : str; }/*from w ww . j av a 2 s. c o m*/ public static boolean isBlank(String str) { return str == null || str.trim().length() == 0; } public static String trim(String str) { return (null == str) ? null : str.trim(); } }