Java Utililty Methods Object NVL

List of utility methods to do Object NVL

Description

The list of methods to do Object NVL are organized into topic(s).

Method

Tnvl(final T t, final T def)
Like Oracle's nvl, which is like coalesce with only two arguments
return t == null ? def : t;
intnvl(Integer value, Number valueWhenNull)
Imitates the nvl function of Oracle SQL.
if (value != null) {
    return value;
} else {
    return valueWhenNull.intValue();
longNVL(Long l)
NVL
if (l == null) {
    return 0L;
return l.longValue();
Objectnvl(Object a, Object b, Object c)
nvl
if (a != null)
    return a;
if (b != null)
    return b;
return c;
Objectnvl(Object arg0, Object arg1)
nvl
return arg0 != null ? arg0 : arg1;
Objectnvl(Object inputObject, Object defaultObject)
nvl
return inputObject != null ? inputObject : defaultObject;
StringNVL(Object obj, String defaultVaue)
NVL
if (obj != null)
    return obj.toString();
else
    return defaultVaue;
Objectnvl(Object objInput, Object objOutput)
nvl
if (objInput != null) {
    return objInput;
} else {
    return objOutput;
Objectnvl(Object source, Object alernative)
nvl
if (source == null) {
    return alernative;
return source;
StringNVL(Object str)
NVL
if (str == null) {
    return "";
return NVL(str.toString());