Java Object NVL nvl(Object a, Object b, Object c)

Here you can find the source of nvl(Object a, Object b, Object c)

Description

nvl

License

Open Source License

Return

the object that is not null

Declaration

public static final Object nvl(Object a, Object b, Object c) 

Method Source Code

//package com.java2s;
/*//from w  w  w.ja  va  2  s.c o m
 * This file is part of the Jose Project
 * see http://jose-chess.sourceforge.net/
 * (c) 2002-2006 Peter Sch?fer
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 */

public class Main {
    /**   @return the object that is not null   */
    public static final Object nvl(Object a, Object b) {
        if (a != null)
            return a;
        return b;
    }

    /**   @return the object that is not null   */
    public static final Object nvl(Object a, Object b, Object c) {
        if (a != null)
            return a;
        if (b != null)
            return b;
        return c;
    }

    /**   @return the number that is not zero   */
    public static final int nvl(int a, int b) {
        return (a != 0) ? a : b;
    }
}

Related

  1. nvl(CharSequence source)
  2. nvl(E expr1, E expr2)
  3. nvl(final T t, final T def)
  4. nvl(Integer value, Number valueWhenNull)
  5. NVL(Long l)
  6. nvl(Object arg0, Object arg1)
  7. nvl(Object inputObject, Object defaultObject)
  8. NVL(Object obj, String defaultVaue)
  9. nvl(Object objInput, Object objOutput)