Java Object NVL nvl(Object value, String defaultValue)

Here you can find the source of nvl(Object value, String defaultValue)

Description

nvl

License

Open Source License

Declaration

public static String nvl(Object value, String defaultValue) 

Method Source Code

//package com.java2s;
/*//from  w  ww.j  ava 2  s  .co m
 License:
    
 blueprint-sdk is licensed under the terms of Eclipse Public License(EPL) v1.0
 (http://www.eclipse.org/legal/epl-v10.html)
    
    
 Distribution:
    
 Repository - https://github.com/lempel/blueprint-sdk.git
 Blog - http://lempel.egloos.com
 */

public class Main {
    @SuppressWarnings("WeakerAccess")
    public static String nvl(Object value) {
        String result;
        if (value == null) {
            result = "";
        } else {
            result = value.toString().trim();
        }
        return result;
    }

    public static String nvl(Object value, String defaultValue) {
        String result = defaultValue;
        if (value != null) {
            result = value.toString();
        }
        return result;
    }
}

Related

  1. NVL(Object obj, String defaultVaue)
  2. nvl(Object objInput, Object objOutput)
  3. nvl(Object source, Object alernative)
  4. NVL(Object str)
  5. nvl(Object value, Object substituteWhenNull)
  6. nvl(Object value, String valueWhenNull)
  7. nvl(S obj, U nullObject)
  8. nvl(String instr, String defaultValue)
  9. nvl(String instr, String defaultValue)