Skip to content

Instantly share code, notes, and snippets.

@CrystalMethod
Created February 28, 2014 22:23
Show Gist options
  • Save CrystalMethod/9281257 to your computer and use it in GitHub Desktop.
Save CrystalMethod/9281257 to your computer and use it in GitHub Desktop.
Simple Detail Formatter to show detailed information on Neo4j Relationships in "Variables" View (Eclipse Debugger).
StringBuilder sb = new StringBuilder();
sb.append("Id: ");
sb.append(getId());
sb.append("\nType: ");
sb.append(getType().name());
sb.append("\nStart: ");
sb.append(getStartNode().getId());
sb.append("\nEnd: ");
sb.append(getEndNode().getId());
sb.append("\nProperties: ");
Iterable<String> keys = getPropertyKeys();
StringBuilder sub = new StringBuilder();
for (String key : keys) {
sub.append(key);
sub.append(':');
sub.append(getProperty(key).toString());
sub.append(", ");
}
if (sub.length() > 1) {
sub.deleteCharAt(sub.length() - 1);
sub.deleteCharAt(sub.length() - 1);
}
sb.append(sub.toString());
return sb.toString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment