Re: [project lombok] method "pointers"

40 views
Skip to first unread message

Mat Jaggard

unread,
Jan 18, 2013, 8:07:24 AM1/18/13
to project...@googlegroups.com
This is already being added into Java 8.


On 18 January 2013 11:53, Stummi <mic...@stummi.org> wrote:
Hi,

At first: I just started with lombok and its great.

i am not sure if this is already possible with lombok. If not, i think this could be a great new feature.

I have a lot of boilerplate defining callback-interfaces just calling an method:

        JButton btn = new JButton() ;
        btn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                someMethod();
            }
        });

And if you don't like anonymous classes like me, you often have do define a new inner class just for this case, which is also a bit more boileplate

Same effect i have often with for example the Runnable-Interface.

It would be great if lombok could crush this type of boilerplate anyhow.

Kind regards,
Michael

--
 
 

Reply all
Reply to author
Forward
0 new messages