Created
February 4, 2019 14:21
-
-
Save VincentQueignec/09e88a61f06046c93356adde65eb7c5b to your computer and use it in GitHub Desktop.
Optional getter template
This file contains hidden or 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.ofNullable($field.name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment