Normalize an object to a string

From Stack Overflow
Jump to: navigation, search
    /**
     * "Normalize" a value to a string (that is, nulls become empty strings).
     */
    public static String normalizeString(Object s)
    {
        return (s == null) ? "" : s.toString();
    }

Personal tools