Here you can find the source of nvl(Object value, String valueWhenNull)
value
, or valueWhenNull
if value is null.
Parameter | Description |
---|---|
value | a parameter |
valueWhenNull | a parameter |
public static String nvl(Object value, String valueWhenNull)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010-2015 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/* w w w.ja va 2s . com*/ * BSI Business Systems Integration AG - initial API and implementation ******************************************************************************/ public class Main { /** * Returns the string-representation of <code>value</code>, or <code>valueWhenNull</code> if value is null. * * @param value * @param valueWhenNull * @see #substituteWhenEmpty(Object, String) */ public static String nvl(Object value, String valueWhenNull) { if (value != null) { return value.toString(); } else { return valueWhenNull; } } }