Java Null Value Convert null2blank(String prnStr)

Here you can find the source of null2blank(String prnStr)

Description

nullblank

License

Open Source License

Declaration

public static String null2blank(String prnStr) 

Method Source Code

//package com.java2s;
/*/*from   www  . j a v a 2s.  co m*/
 * M2M ServiceFOTA ONM version 1.0
 *
 *  Copyright ? 2014 kt corp. All rights reserved.
 *
 *  This is a proprietary software of kt corp, and you may not use this file except in
 *  compliance with license agreement with kt corp. Any redistribution or use of this
 *  software, with or without modification shall be strictly prohibited without prior written
 *  approval of kt corp, and the copyright notice above does not evidence any actual or
 *  intended publication of such software.
 */

public class Main {

    public static String null2blank(String prnStr) {
        if (prnStr == null)
            return "";
        else
            return prnStr;
    }

    public static String null2blank(String prnStr, String defaultValue) {
        if (prnStr == null)
            return defaultValue;
        else
            return prnStr;
    }
}

Related

  1. convertNullToLong(Object orgStr, Long convertStr)
  2. convertNullToOne(final Object value)
  3. convertNullToSolrValue(String fieldName)
  4. convertNullToString(final String str)
  5. convertNullValue(final Class convertType)
  6. null2blank(String source)
  7. null2Boolean(Object expression, boolean defValue)
  8. null2Boolean(Object s)
  9. null2default(final String str, final String def)