Created
March 18, 2016 11:15
-
-
Save ghusta/3328abca814e8d8d727c to your computer and use it in GitHub Desktop.
Fluent Setter template for IntelliJ
This file contains 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
#set($paramName = $helper.getParamName($field, $project)) | |
public ## | |
#if($field.modifierStatic) | |
static void ## | |
#else | |
$classname ## | |
#end | |
with$StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))($field.type $paramName) { | |
#if ($field.name == $paramName) | |
#if (!$field.modifierStatic) | |
this.## | |
#else | |
$classname.## | |
#end | |
#end | |
$field.name = $paramName; | |
#if(!$field.modifierStatic) | |
return this; | |
#end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Set it in IntelliJ this way :
Generate > Setter
Add a template ("Fluent Setter"), with the content of the template.
More info in this blog (french) : https://guillaumehusta.wordpress.com/2016/03/18/generateur-de-methodes-fluent-en-java-avec-intellij/