Created
March 2, 2017 10:39
-
-
Save Keshava11/a0d371ab3194887c36628752e6b2b4ff to your computer and use it in GitHub Desktop.
Android Studio Getter template for member names starting with 'm' and 's'
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 | |
$field.type ## | |
#set($name = $StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))) | |
#if ($name.length() > 1 && ($StringUtil.startsWith($name, 'm') || $StringUtil.startsWith($name, 's'))) | |
#set($name = $name.substring(1)) | |
#end | |
#if ($field.boolean && $field.primitive) | |
#if ($StringUtil.startsWithIgnoreCase($name, 'is')) | |
#set($name = $StringUtil.decapitalize($name)) | |
#else | |
is## | |
#end | |
#else | |
get## | |
#end | |
${name}() { | |
return $field.name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment