Here you can find the source of null2default(final String str, final String def)
public static final String null2default(final String str, final String def)
//package com.java2s; //License from project: Apache License public class Main { public static final String null2default(final String str, final String def) { return (str == null || str.length() <= 0) ? def : str; }/*from w ww . ja v a 2 s .c o m*/ }