Created
March 28, 2018 06:14
-
-
Save suvodeep-pyne/4ec3a52b4b25d0026a98cf5d75d02c86 to your computer and use it in GitHub Desktop.
Intellij Getter template for generating getters with Optional
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
#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