Skip to content

Instantly share code, notes, and snippets.

@adisesha
Created May 12, 2016 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adisesha/afe9bd99c6986a79f7bc326050679d66 to your computer and use it in GitHub Desktop.
Save adisesha/afe9bd99c6986a79f7bc326050679d66 to your computer and use it in GitHub Desktop.
Fluent setters and getters templates for InteliJ Idea
public ##
#if($field.modifierStatic)
static ##
#end
$field.type ##
#set($name = $StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))
${name}() {
return $field.name;
}
#set($paramName = $helper.getParamName($field, $project))
public ##
#if($field.modifierStatic)
static void ##
#else
$classname ##
#end
$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