Skip to content

Instantly share code, notes, and snippets.

@suvodeep-pyne
Created March 28, 2018 06:14
Show Gist options
  • Save suvodeep-pyne/4ec3a52b4b25d0026a98cf5d75d02c86 to your computer and use it in GitHub Desktop.
Save suvodeep-pyne/4ec3a52b4b25d0026a98cf5d75d02c86 to your computer and use it in GitHub Desktop.
Intellij Getter template for generating getters with Optional
#if($field.modifierStatic)
static ##
#end
Optional<$field.type> ##
#set($name = $StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project))))
#if ($field.boolean && $field.primitive)
is##
#else
get##
#end
${name}() {
return Optional.of($field.name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment