Builder without overriding toString.

725 views
Skip to first unread message

Mohana Rao S V

unread,
May 14, 2015, 9:25:08 AM5/14/15
to project...@googlegroups.com
Hi 

  I'm using @Builder but it's overriding toString method which is i don't want because it's already overriding in the super class called AbstractVo. Is there any way to tell to lombok use @Builder but skip overriding toString method.

Thanks in advance.

Martin Grajcar

unread,
May 14, 2015, 12:07:34 PM5/14/15
to project...@googlegroups.com
Writing your own toString and delegating to super should solve it.

--
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.
For more options, visit https://groups.google.com/d/optout.

Mohana Rao S V

unread,
May 15, 2015, 2:22:48 AM5/15/15
to project...@googlegroups.com
Yes, you are correct that works, But it would be nice to have flag to override toString or not.

What do you think about this.

Marco Servetto

unread,
May 15, 2015, 2:30:00 AM5/15/15
to project...@googlegroups.com
I do not know if that flag would be a good idea or not.
Lombock is very coherent in its "not implementing methods already
generated by the used"
and flags like that would become a pervasive thing, there would be flags for
not generating tons of things...

Sarthak Nandi

unread,
Jul 22, 2016, 5:05:59 AM7/22/16
to Project Lombok
@Marco if we want to exclude toString method from builder by overriding it ourselves, we will first have to add the builder, which would defeat the whole purpose of lombok.
We don't want to add toString in builders in my company.
Reply all
Reply to author
Forward
0 new messages