Skip to content

Instantly share code, notes, and snippets.

@rishibarve
Created August 10, 2018 06:02
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 rishibarve/9c830014d8313130700ca2f63671b3f6 to your computer and use it in GitHub Desktop.
Save rishibarve/9c830014d8313130700ca2f63671b3f6 to your computer and use it in GitHub Desktop.
Template for generating setter with checking not null in IntelliJ Idea
#set($paramName = $helper.getParamName($field, $project))
#if($field.modifierStatic)
static ##
#end
void set$StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))($field.type $paramName) {
if($paramName != null){
#if ($field.name == $paramName)
#if (!$field.modifierStatic)
this.##
#else
$classname.##
#end
#end
$field.name = $paramName;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment