Skip to content

Instantly share code, notes, and snippets.

View markwatson's full-sized avatar
💻
hacking the mainframe

Mark Watson markwatson

💻
hacking the mainframe
View GitHub Profile
@markwatson
markwatson / toString Generator
Created February 9, 2016 07:02 — forked from jenslohmann/toString Generator
Java toString() generator for IntelliJ IDEA that generates JSON
public java.lang.String toString() {
#if ( $members.size() > 0 )
#set ( $i = 0 )
return "{\"_class\":\"$classname\", " +
#foreach( $member in $members )
#set ( $i = $i + 1 )
#if ( $i == $members.size() )
#set ( $postfix = "+" )
#else
#set ( $postfix = "+ "", "" + " )