Query regarding method generation

27 views
Skip to first unread message

Omkar Nath Singh

unread,
Apr 22, 2021, 7:54:38 AM4/22/21
to Project Lombok

Hi Lombok people,

I have been using Lombok for a while, I use @Data annotation mostly as I wanted to generate getters and setters, but wanted to know if there is possibility to generate method also?


vannilla :

@FindBy(id = "titleID")
WebElement title;

public Label title() {
    return new Label(title);
}



Does Lombok support anything like this?

@FindBy(id = "titleID")
@SomeAnnonation(type = Label.class, name="title")
WebElement title;

where SomeAnnonation I want to know if it exists? such that it generated a method with return type mentioned and name is the method name?

Here @FindBy is from Selenium team, ignore that.


Thanks,
Omkar

Jan Materne

unread,
Apr 22, 2021, 9:48:56 AM4/22/21
to project...@googlegroups.com
Returning just the field could be done with @Getter. Transforming the value is a different story - thats too specific.

Jan

--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-lombo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/project-lombok/60c64c9a-d07b-499a-8c58-45f63ef3ed02n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages