Skip to content

Instantly share code, notes, and snippets.

Avatar

Fabio José Bohnenberger fabiojb

  • Brazil
View GitHub Profile
@fabiojb
fabiojb / toString JSON generator
Last active Jul 23, 2020 — forked from jenslohmann/toString Generator
Java toString() generator for IntelliJ IDEA that generates JSON
View toString JSON generator
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 = "+ "", "" + " )