Here you can find the source of nvl(CharSequence source)
public static String nvl(CharSequence source)
//package com.java2s; //License from project: Apache License public class Main { public static String nvl(CharSequence source, String re) { CharSequence val = hasText(source) ? source : re; return val.toString(); }/*from ww w . ja v a 2s .co m*/ public static String nvl(CharSequence source) { return nvl(source, ""); } public static String nvl(Object o) { return o == null ? "" : o.toString(); } public static boolean hasText(CharSequence str) { if (!hasLength(str)) return false; int strLen = str.length(); for (int i = 0; i < strLen; i++) if (!Character.isWhitespace(str.charAt(i))) return true; return false; } public static boolean hasLength(CharSequence str) { return str != null && str.length() > 0; } public static boolean hasLength(String str) { return hasLength(((CharSequence) (str))); } }