Java Object NVL NVLn(String str, String replace)

Here you can find the source of NVLn(String str, String replace)

Description

NVLn - fix null value (numeric)

License

Apache License

Parameter

Parameter Description
str a parameter
replace a parameter

Declaration

public static String NVLn(String str, String replace) 

Method Source Code

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

public class Main {
    /**//from  w  ww.j  a  v  a  2  s .  c om
     * NVLn - fix null value (numeric)
     * @param str
     * @param replace
     * @return
     */
    public static String NVLn(String str, String replace) {
        return NVL(str, replace);
    }

    /**
     * NVLn - fix null value (numeric) 
     * @param str
     * @return
     */
    public static String NVLn(String str) {
        return NVL(str, "null");
    }

    /**
     * NVL - fix null value
     * @param String value
     * @param replace with 
     * @return
     */
    public static String NVL(String str, String replace) {
        if (str == null || str.trim().equals("") || str.trim().toUpperCase().equals("NULL"))
            return replace;
        return str;
    }

    /**
     * NVL - fix null value 
     * @param string value 
     * @return
     */
    public static String NVL(String str) {
        return NVL(str, "");
    }
}

Related

  1. nvlArr(String[][] planarArr)
  2. nvlDefault(String val)
  3. nvlEmptyString(String object)
  4. nvlInteger(String pString, Integer pInteger)
  5. nvlLang(Object contend)
  6. nvlt(Object o)