Java Object to String objectToString(Object objectStr)

Here you can find the source of objectToString(Object objectStr)

Description

object To String

License

Open Source License

Declaration

public static String objectToString(Object objectStr) 

Method Source Code

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

public class Main {
    public static String objectToString(Object objectStr) {
        if (objectStr == null)
            objectStr = "";
        if ("null".equalsIgnoreCase(String.valueOf(objectStr)))
            objectStr = "";
        return String.valueOf(objectStr);
    }/*from w w w  .  j a v  a 2 s.c o  m*/

    public static String objectToString(Object objectStr, String e) {
        if (objectStr == null)
            objectStr = e;
        if ("null".equalsIgnoreCase(String.valueOf(objectStr)))
            objectStr = e;
        return String.valueOf(objectStr);
    }
}

Related

  1. objectToString(Object obj)
  2. objectToString(Object obj)
  3. objectToString(Object obj, String defaultvalue)
  4. objectToString(Object object)
  5. objectToString(Object object, String defaultValue)
  6. objectToString(Object x)
  7. ObjectToString(Object x)
  8. objectToString(Object[] obj)
  9. objectToStringNoNull(Object obj)