Java Object NVL nvl(String x, String y)

Here you can find the source of nvl(String x, String y)

Description

nvl

License

Open Source License

Declaration

public static final String nvl(String x, String y) 

Method Source Code

//package com.java2s;
/*/*from   w  w w  . j  av  a2s.com*/
 * 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 {
    public static final String nvl(String x, String y) {
        if (x == null || x.length() == 0)
            return y;
        else
            return x;
    }

    public static final int length(Object string) {
        if (string instanceof String)
            return ((String) string).length();
        if (string instanceof StringBuffer)
            return ((StringBuffer) string).length();
        throw new IllegalArgumentException("expecting String or StringBuffer");
    }
}

Related

  1. NVL(String str, String replace)
  2. nvl(String string)
  3. nvl(String value)
  4. nvl(String value, String defaultValue)
  5. NVL(String value, String replace)
  6. nvl(T mainValue, T... fallbackValues)
  7. nvl(T o, T replacement)
  8. nvl(T o, T valueIfNull)
  9. nvl(T object, T defaultValue)