Java Object NVL nvl(T object, T defaultValue)

Here you can find the source of nvl(T object, T defaultValue)

Description

plsql has one or two useful functions and this is one of them.

License

Apache License

Parameter

Parameter Description
object a parameter
defaultValue a parameter

Declaration

public static <T> T nvl(T object, T defaultValue) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*  w w  w  . j a va  2  s  .co m*/
     * plsql has one or two useful functions and this is one of them.
     * @param object
     * @param defaultValue
     * @return
     */
    public static <T> T nvl(T object, T defaultValue) {
        return object != null ? object : defaultValue;
    }
}

Related

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