Java Object to String objectToString(Object o)

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

Description

object To String

License

Apache License

Declaration

public static String objectToString(Object o) 

Method Source Code

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

public class Main {
    public static String objectToString(Object o) {
        if (o == null) {
            return "";
        }/*ww  w  . jav a 2  s .  co  m*/
        try {
            return o.toString();
        } catch (Exception e) {
            return "Exception converting object to string FormatUtils.objectToString(): " + e.getMessage();
        }
    }
}

Related

  1. castToStringArray(Object[] array)
  2. objectToString(final Object value)
  3. objectToString(Object a_Object)
  4. objectToString(Object in)
  5. objectToString(Object in, boolean ignoreNull)
  6. objectToString(Object o)
  7. objectToString(Object o)
  8. objectToString(Object o, boolean quoteStrings)
  9. objectToString(Object obj)