Skip to content

v1.0

Latest
Compare
Choose a tag to compare
@eugenelesnov eugenelesnov released this 16 Oct 14:51
· 3 commits to main since this release

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
}