Last active
December 10, 2015 05:38
-
-
Save P7h/4388630 to your computer and use it in GitHub Desktop.
Guava API toString() method generator for a JavaBean or POJO for IntelliJ IDEA.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Guava API toString() method generator for a JavaBean / POJO. | |
* @return String representation of all the attributes of the bean. | |
*/ | |
public String toString() { | |
#set ($autoImportPackages = "com.google.common.base.Objects") | |
return Objects.toStringHelper(this) | |
#foreach ($member in $members) | |
.add("$member.name", $member.accessor) | |
#end | |
.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment