Here you can find the source of nvl(T... objs)
public static <T> T nvl(T... objs)
//package com.java2s; /*//from w w w .jav a2 s . c o m * Copyright (C) 2010 Viettel Telecom. All rights reserved. * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ public class Main { public static String nvl(String strNullOrZero) { return isStringNullOrEmpty(strNullOrZero) ? " " : strNullOrZero; } public static <T> T nvl(T... objs) { for (T obj : objs) { if (obj != null) { return obj; } } return null; } public static boolean isStringNullOrEmpty(Object obj1) { return obj1 == null || obj1.toString().trim().equals(""); } }