Java Identity to String identityToString(Object pObject)

Here you can find the source of identityToString(Object pObject)

Description

Returns a string on the same format as Object.toString() .

License

Open Source License

Parameter

Parameter Description
pObject the object

Return

the object as a String on the format of Object.toString()

Declaration

public static String identityToString(Object pObject) 

Method Source Code

//package com.java2s;

public class Main {
    /**// w w  w . jav a2  s  . c  o m
     * Returns a string on the same format as {@code Object.toString()}.
     *
     * @param pObject the object
     * @return the object as a {@code String} on the format of
     *         {@code Object.toString()}
     */
    public static String identityToString(Object pObject) {
        if (pObject == null) {
            return null;
        } else {
            return pObject.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(pObject));
        }
    }
}

Related

  1. identityToString(final Object o)
  2. identityToString(final Object obj)
  3. identityToString(Object obj)
  4. identityToString(Object obj)
  5. identityToString(Object obj)
  6. identityToString(StringBuffer buffer, Object object)
  7. identityToSubject(String identity)