optional-getter 1.0
Generating getter method with Optional as a return type by annotation using Groovy and AST transformations.
What is it?
Let's assume you have class like this:
class Foo {
private String someField
}
And you want to have method Optional<String> getSomeFieldOptional()
Sounds like a boilerplate, huh?
Well, put @OptionalGetter
on field and enjoy the magic of AST transformations :)
class Foo {
@OptionalGetter
private String someField
}