Java Object NVL nvl(Object inputObject, Object defaultObject)

Here you can find the source of nvl(Object inputObject, Object defaultObject)

Description

nvl

License

Apache License

Declaration

public static Object nvl(Object inputObject, Object defaultObject) 

Method Source Code

//package com.java2s;
/*/*from   w w  w.  j a v  a2s . co  m*/
 * Copyright 2002-2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

public class Main {

    public static Object nvl(Object inputObject, Object defaultObject) {
        return inputObject != null ? inputObject : defaultObject;
    }

    public static String nvl(String inputString, String defaultString) {
        return (String) nvl((Object) inputString, (Object) defaultString);
    }
}

Related

  1. nvl(final T t, final T def)
  2. nvl(Integer value, Number valueWhenNull)
  3. NVL(Long l)
  4. nvl(Object a, Object b, Object c)
  5. nvl(Object arg0, Object arg1)
  6. NVL(Object obj, String defaultVaue)
  7. nvl(Object objInput, Object objOutput)
  8. nvl(Object source, Object alernative)
  9. NVL(Object str)