Here you can find the source of emptyStringIfNull(String s)
public static String emptyStringIfNull(String s)
//package com.java2s; //License from project: Apache License public class Main { public static String emptyStringIfNull(String s) { return (s == null || s.equals("")) ? "-" : s; }/*from w w w . j a v a 2 s .co m*/ }