Java Object NVL nvl(T value, T ifnull)

Here you can find the source of nvl(T value, T ifnull)

Description

Replicates the Oracle NVL function, if the value is null, then substitute a different value in its place

License

Apache License

Declaration

public static final <T> T nvl(T value, T ifnull) 

Method Source Code

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

public class Main {
    /**//from   w  w  w  .  j a va2  s .c  o m
     * Replicates the Oracle NVL function, if the value is null, then substitute a different value in its place
     */
    public static final <T> T nvl(T value, T ifnull) {
        return (value == null) ? ifnull : value;
    }

    public static final String nvl(String value) {
        return (value == null) ? "" : value;
    }
}

Related

  1. nvl(T s, T def)
  2. nvl(T t, String message)
  3. nvl(T t, String message)
  4. nvl(T value, String defValue)
  5. nvl(T value, T defaultValue)
  6. nvl(T value, T replacement)
  7. nvl(T value, T replacement)
  8. nvl(T value, T value2)
  9. nvl(T... objs)