Last active
June 2, 2018 16:27
-
-
Save serj-lotutovici/845062d79af0ca6461bf to your computer and use it in GitHub Desktop.
Kotlin Style Getter and Setter templates for IntelliJ Idea. https://www.jetbrains.com/idea/help/generating-getters-and-setters.html for more info
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
public ## | |
#if($field.modifierStatic) | |
static ## | |
#end | |
$field.type ## | |
#set($name = $StringUtil.decapitalize($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))) | |
${name}() { | |
return $field.name; | |
} |
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($name = $StringUtil.decapitalize($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))) | |
${name}($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
Is there an IntelliJ template grammar reference?