Java Object NVL nvl(T... objs)

Here you can find the source of nvl(T... objs)

Description

nvl

License

Open Source License

Declaration

public static <T> T nvl(T... objs) 

Method Source Code

//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("");
    }
}

Related

  1. nvl(T value, T ifnull)
  2. nvl(T value, T replacement)
  3. nvl(T value, T replacement)
  4. nvl(T value, T value2)
  5. nvl(T... objs)
  6. nvl(T... objs)
  7. nvl(T... values)
  8. nvl(T... values)
  9. nvl2(Object obj, Object obj1, Object obj2)