src/main/java/com/zandero/utils/StringUtils.java
public static String trimToNull(String text) {

		text = trim(text);

		if (text == null || text.isEmpty()) {
			return null;
		}

		return text;
	}
public static String trimToNull(String text) {

		text = trim(text);

		if (text == null || text.isEmpty()) {
			return null;
		}

		return text;
	}
Trims down text to null if empty

@param text to be trimmed
@return text or null if empty