Java Class Simple Name Get simpleClassName(Object object)

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

Description

simple Class Name

License

Apache License

Declaration

public static String simpleClassName(Object object) 

Method Source Code

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

public class Main {
    public static String simpleClassName(Object object) {
        if (object == null) {
            return "null_object";
        }/*from   ww  w.  j av  a  2 s .  co  m*/

        Class clazz = object.getClass();
        Package pkg = clazz.getPackage();
        if (pkg != null) {
            return clazz.getName().substring(pkg.getName().length() + 1);
        } else {
            return clazz.getName();
        }
    }
}

Related

  1. simpleClassName(Class clazz)
  2. simpleClassName(Class type)
  3. simpleClassName(final String className)
  4. simpleClassName(Object o)
  5. simpleClassName(Object o)
  6. simpleClassName(String fqn)
  7. simpleClassNameAndHashCodeString(Object object)
  8. simpleClassNameAndHashCodeString(Object object)
  9. simpleClassNameFrom(String fqClassName)