Suggested abbrevation: getset
Applicable in Java
» Declaration
The live template:
/**
* Set $DESC$.
*
* @param $P_NAME$ $CAP_DESC$
*/
public final void set$SET_NAME$(final $TYPE$ $P_NAME$) {
$NAME$ = $P_NAME$;
}
/**
* Get $DESC$.
*
* @return $CAP_DESC$
*/
public final $TYPE$ get$SET_NAME$() {
return $NAME$;
}
$END$
The variables:
NAME
-suggestFirstVariableName("Object")
- Don't skipTYPE
-typeOfVariable(NAME)
- SkipDESC
-underscoresToSpaces(snakeCase(NAME))
- Don't skipCAP_DESC
-capitalize(DESC)
- SkipSET_NAME
-capitalize(NAME)
- SkipP_NAME
-groovyScript("def result= _1.substring(0,1); return result;", NAME)
- Skip
thanks 👍
that was helpful