Java Utililty Methods Identity to String

List of utility methods to do Identity to String

Description

The list of methods to do Identity to String are organized into topic(s).

Method

StringidentityToString(final Object o)
Retrieves the same String for the given Object as would be returned by the default method toString(), whether or not the given Object's class overrides toString(), the toString equivalent of System.identityHashCode
return o == null ? null : o.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(o));
StringidentityToString(final Object obj)
Returns String expression of the given Object.
if (obj == null) {
    return null;
return obj.getClass().getSimpleName() + '@' + Integer.toHexString(System.identityHashCode(obj));
StringidentityToString(Object obj)
Return a String representation of an object's overall identity.
if (obj == null) {
    return EMPTY_STRING;
return obj.getClass().getName() + "@" + getIdentityHexString(obj);
StringidentityToString(Object obj)
Returns a string value of an object similar to that returned by Object.toString().
return (obj == null) ? "null" : obj.getClass().getName() + "@" + System.identityHashCode(obj);
StringidentityToString(Object obj)
identity To String
return obj == null ? "" : obj.getClass().getName() + "@" + getIdentityHexString(obj);
StringidentityToString(Object pObject)
Returns a string on the same format as Object.toString() .
if (pObject == null) {
    return null;
} else {
    return pObject.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(pObject));
voididentityToString(StringBuffer buffer, Object object)
identity To String
if (object == null) {
    throw new NullPointerException("Cannot get the toString of a null identity");
buffer.append(object.getClass().getName()).append('@')
        .append(Integer.toHexString(System.identityHashCode(object)));
StringidentityToSubject(String identity)
identity To Subject
if (identity != null) {
    String s = identity.substring(1);
    return s.replace('/', ',');
} else {
    return null;