Here you can find the source of nvl(T s, T def)
public static <T> T nvl(T s, T def)
//package com.java2s; //License from project: Open Source License public class Main { public static String nvl(String s, String def) { return s != null ? s : def; }// w w w . j a va 2 s .co m public static <T> T nvl(T... ts) { for (T t : ts) { if (t != null) return t; } return null; } public static <T> T nvl(T s, T def) { return s != null ? s : def; } public static String nvl(String s) { return nvl(s, ""); } }