Java Object NVL nvl(T s, T def)

Here you can find the source of nvl(T s, T def)

Description

nvl

License

Open Source License

Declaration

public static <T> T nvl(T s, T def) 

Method Source Code

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

Related

  1. nvl(String x, String y)
  2. nvl(T mainValue, T... fallbackValues)
  3. nvl(T o, T replacement)
  4. nvl(T o, T valueIfNull)
  5. nvl(T object, T defaultValue)
  6. nvl(T t, String message)
  7. nvl(T t, String message)
  8. nvl(T value, String defValue)
  9. nvl(T value, T defaultValue)