IntelliJ has the cool feature to generate Java getters. For example, for a field private final String foo
, it will generate a getter getFoo()
.
Is there any way I can configure IntelliJ to generate getters in the format String foo()
? I am working mainly with immutable objects and prefer this syntax.
Neat question! Just to clarify @Danny Dan's answer since IntelliJ 15 has been released...
fluent-getter
public ##
#if($field.modifierStatic)
static ##
#end
$field.type ##
${field.name}() {
return $field.name;
}
Checkout Implementing Domain-Driven Design:
The simple but effective approach to object design keeps the Value Object faithful to the Ubiquitous Language. The use of
getValuePercentage()
is a technical computer statement, butvaluePercentage()
is a fluent human-readable language expression.