Here you can find the source of emptyToDefault(String value, String def)
public static String emptyToDefault(String value, String def)
//package com.java2s; //License from project: Apache License public class Main { public static String emptyToDefault(String value, String def) { return (value == null || value.length() == 0) ? def : value; }//from w ww . ja va 2 s .com }