Java String Value Of valueOf(Object object, String defaultEmptyValue)

Here you can find the source of valueOf(Object object, String defaultEmptyValue)

Description

value Of

License

Open Source License

Declaration

public static String valueOf(Object object, String defaultEmptyValue) 

Method Source Code

//package com.java2s;
/**//from   w  w w.  j ava 2  s  .  c  om
 * <p>
 * Simple utility class for String operations useful across the framework.
 * <p/>
 * <p>
 * Some methods in this class were copied from the Spring Framework so we didn't
 * have to re-invent the wheel, and in these cases, we have retained all
 * license, copyright and author information.
 *
 * @since 0.9
 */

public class Main {
    public static String valueOf(Object object) {

        return valueOf(object, "");
    }

    public static String valueOf(Object object, String defaultEmptyValue) {

        if (object == null) {
            return defaultEmptyValue;
        }

        return String.valueOf(object);
    }
}

Related

  1. valueOf(final Class enumType, final String value)
  2. valueOf(final Class type, final String value)
  3. valueOf(final Class clazz, final String name)
  4. valueOf(final Class enumType, final String name)
  5. valueOf(final Object obj, final String defaultValue)
  6. valueOf(String boolStr)
  7. valueOf(String decimal)
  8. valueOf(String first, String defaultstr)
  9. valueOf(String format, String value)