Java Null Value Convert convertNullableString(Object object)

Here you can find the source of convertNullableString(Object object)

Description

convert Nullable String

License

Open Source License

Declaration

public static String convertNullableString(Object object) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String convertNullableString(Object object) {
        if (object == null) {
            return new String();
        }/*from  www. j av  a  2s.  c  o m*/

        return object.toString();
    }

    public static String convertNullableString(Object object, String defaultValue) {
        if (object == null) {
            return defaultValue;
        }

        return object.toString();
    }
}

Related

  1. convertNull(Object o)
  2. convertNull(Object source)
  3. convertNull2ZeroString(String value)
  4. convertNullString2Empty(Object str)
  5. convertNullToBlank(String s)
  6. convertNullToEmptyStr(String inObj)
  7. convertNullToEmptyString(Object raw)