Skip to content

Instantly share code, notes, and snippets.

@seanf
Created November 26, 2021 03:56
Show Gist options
  • Save seanf/0719edbe7ebfe74f4a9716fe4ae30e95 to your computer and use it in GitHub Desktop.
Save seanf/0719edbe7ebfe74f4a9716fe4ae30e95 to your computer and use it in GitHub Desktop.
describe: a cheap toString substitute for objects which may have verbose toString implementations
public static String describe(Object obj) {
return obj.getClass().getSimpleName() + '@' + System.identityHashCode(obj);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment