Java Null Value Convert convertNullToEmptyString(String value)

Here you can find the source of convertNullToEmptyString(String value)

Description

Converts value to a empty string if value is null.

License

Apache License

Parameter

Parameter Description
value the checked value.

Return

the converted value.

Declaration

static String convertNullToEmptyString(String value) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2006-2007 Koji Hisano <hisano@gmail.com> - UBION Inc. Developer
 * Copyright (c) 2006-2007 UBION Inc. <http://www.ubion.co.jp/>
 * /*from   w w w. j  a va2 s. c o m*/
 * Copyright (c) 2006-2007 Skype Technologies S.A. <http://www.skype.com/>
 * 
 * Skype4Java is licensed under either the Apache License, Version 2.0 or
 * the Eclipse Public License v1.0.
 * You may use it freely in commercial and non-commercial products.
 * You may obtain a copy of the licenses at
 *
 *   the Apache License - http://www.apache.org/licenses/LICENSE-2.0
 *   the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html
 *
 * If it is possible to cooperate with the publicity of Skype4Java, please add
 * links to the Skype4Java web site <https://developer.skype.com/wiki/Java_API> 
 * in your web site or documents.
 * 
 * Contributors:
 * Koji Hisano - initial API and implementation
 ******************************************************************************/

public class Main {
    /**
     * Converts value to a empty string if value is null.
     * @param value the checked value.
     * @return the converted value.
     */
    static String convertNullToEmptyString(String value) {
        if (value == null) {
            return "";
        }
        return value;
    }
}

Related

  1. convertNullString2Empty(Object str)
  2. convertNullToBlank(String s)
  3. convertNullToEmptyStr(String inObj)
  4. convertNullToEmptyString(Object raw)
  5. convertNullToEmptyString(String s)
  6. convertNullToFalse(Boolean b)
  7. convertNullToInteger(Object orgStr, int convertStr)
  8. convertNullToLong(Object orgStr, Long convertStr)
  9. convertNullToOne(final Object value)