Created
June 22, 2015 15:06
-
-
Save tiwiz/0f566178f4669bb2e37d to your computer and use it in GitHub Desktop.
This is a Builder template (as in Android's Dialog.Builder) for IntelliJ/Android Studio. To import it, open any Java file and right click on an empty space. Go then to Generate > Getter and Setter and click on the "..." button on the Setter's line. From there create a new template with the "+" icon and paste this code
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 | |
set$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