Java Null Value Convert null2empty(Object s)

Here you can find the source of null2empty(Object s)

Description

nullempty

License

Apache License

Declaration

public static String null2empty(Object s) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String null2empty(Object s) {
        if (s == null) {
            return "";
        }//from w  w  w .j a va  2s.  c  o m
        if (s instanceof String) {
            return (String) s;
        }
        return s.toString();
    }
}

Related

  1. null2default(final String str, final String def)
  2. null2dots(Object s)
  3. null2Double(Object s)
  4. null2Double(Object s, double defValue)
  5. null2Empty(Object obj)
  6. null2empty(String str)
  7. null2emptyString(String value)
  8. null2Int(Object object, int def)
  9. null2Length0(String s)