Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for @SuperBuilder #513

Closed
Cepr0 opened this issue Jul 30, 2018 · 70 comments
Closed

Add support for @SuperBuilder #513

Cepr0 opened this issue Jul 30, 2018 · 70 comments

Comments

@Cepr0
Copy link

Cepr0 commented Jul 30, 2018

Short description

Please add support for @SuperBuilder annotation. It's a long-awaited feature and now, with Lombok 1.18.2, it has been released.

Expected behavior

Support for @SuperBuilder annotation

Version information

  • IDEA Version: 2018.1
  • JDK Version: JDK8
  • OS Type & Version: Windows 10 Pro
  • Lombok Plugin Version: 0.19
  • Lombok Dependency Version: 1.18.2

Steps to reproduce

Add Lombok 1.18.2 to the project

@jackmahoney
Copy link

Would love to see this

@aaavang
Copy link

aaavang commented Aug 21, 2018

I was ecstatic when @SuperBuilder was released, but it's largely unusable without IDE integration.

@dabrowt1
Copy link

This would be very helpful for us.

@isaacaggrey
Copy link

I'd be glad to help contribute this, but I'd probably need some direction as I've never made an IntelliJ plugin. @mplushnikov are you or anyone else aware of anyone else working on this?

@smogstate
Copy link

i can help on that, but need a piece of explanation where to start.

@sluongng
Copy link
Contributor

sluongng commented Oct 7, 2018

Is this being worked on by anyone? Or do we have to wait for the annotation to make it out of experimental?

@isaacaggrey
Copy link

@sluongng I don't believe so. If you're familiar with the IntelliJ plugin ecosystem, I say go for it.

I had started to very briefly during my company's hackathon but switched gears early on as I realized I have a lot more to grok looking at the existing Builder code in the plugin as an example.

@crimsonvspurple
Copy link

Support for @SuperBuilder please!

@alishtory
Copy link

My team also need @SuperBuilder Support

@ympadilha
Copy link

Yes please support for @SuperBuilder please! My team also uses it!

@chrabia
Copy link

chrabia commented Oct 25, 2018

+1

@mateusmoury
Copy link

+1 !

@gordon043
Copy link

+1

1 similar comment
@AUsachov
Copy link

+1

@griffico
Copy link

+2 (from paired programmers at major enterprise)

@Littlearphone
Copy link

+10086

@Arunagithub1
Copy link

We are eagerly waiting for support of superbuilder

@alexejk
Copy link
Collaborator

alexejk commented Nov 2, 2018

You are more than welcome to contribute with a PR for this

@dmincf
Copy link

dmincf commented Nov 5, 2018

+1

@binarywang
Copy link

hope it will be implemented soon

@octopus-prime
Copy link

@alexejk
I think nobody here is able to provide a PR without help of the maintainers/collaborators.
Here are people willing to contribute. But they need help.
See #513 (comment) and #513 (comment)

@smogstate
Copy link

i will check on weekend

@timothyBrake
Copy link

Yes that would be awesome as now in a professional environment creating test data for the models is a pain using just the @builder because most probably these models extend from a superclass.

@wollowizard
Copy link

+1

2 similar comments
@timothy-mugayi
Copy link

+1

@msio
Copy link

msio commented Nov 14, 2018

+1

mplushnikov added a commit that referenced this issue Sep 7, 2019
mplushnikov added a commit that referenced this issue Sep 7, 2019
mplushnikov added a commit that referenced this issue Sep 7, 2019
mplushnikov added a commit that referenced this issue Sep 7, 2019
mplushnikov added a commit that referenced this issue Sep 7, 2019
mplushnikov added a commit that referenced this issue Sep 7, 2019
mplushnikov added a commit that referenced this issue Sep 7, 2019
mplushnikov added a commit that referenced this issue Sep 8, 2019
mplushnikov added a commit that referenced this issue Sep 8, 2019
@foresx
Copy link

foresx commented Sep 23, 2019

Hey guys, when will the new release come?

@lehug
Copy link

lehug commented Sep 24, 2019

@behzadian
Copy link

Hey guys, when will the new release come?

https://github.com/mplushnikov/lombok-intellij-plugin/releases/tag/0.27_superbuilder_alpha

Hi, I tried to install plug in but I got error: "Plugin 'Lombok' is incompatible with this installation"
My Idead version is: 2019.1.1 (Build #IU-191.6707.61)

@eric-gymondo
Copy link

eric-gymondo commented Sep 24, 2019

Hey guys, when will the new release come?

https://github.com/mplushnikov/lombok-intellij-plugin/releases/tag/0.27_superbuilder_alpha

Hi, I tried to install plug in but I got error: "Plugin 'Lombok' is incompatible with this installation"
My Idead version is: 2019.1.1 (Build #IU-191.6707.61)

it's only supported by IntelliJ 2019.2+

@cosmin-rezmerita
Copy link

cosmin-rezmerita commented Sep 24, 2019

hi,
i used the lombok-plugin-0.27.0-2019.2 for @SuperBuilder annotation and i have the following structure:

@SuperBuilder
public class A {
public field1;
}

@SuperBuilder
public class B extends A {
public field2;
}

now, i'm trying to use the builder of class A in a scenario like this:

return someOptional
    .map(item -> A.builder().field1(value).build())
    .orElseGet(() -> A.builder().field1(otherClass.method(something)).build());

the error i get is:
Error:(102, 201) java: incompatible types: bad return type in lambda expression
capture#1 of ? cannot be converted to capture#2 of ?
and appears on the line of orElseGet

can you please help me with this?

Version information:
IntellijIdea: IntelliJ IDEA 2019.2.3 (Ultimate Edition) Build #IU-192.6817.14, built on September 24, 2019
Runtime version: 11.0.4+10-b304.69 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

@mplushnikov
Copy link
Owner

@cosmin-rezmerita Interesting usecase! I think you can't use a lambda expression for a functional interface, if the method in the functional interface has type parameters. See section §15.27.3 in JLS8: https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.27.3

But your code should compile if your add explicit cast to the map method: (.map(item -> (A) A.builder().field1(value).build())).

@cosmin-rezmerita
Copy link

cosmin-rezmerita commented Sep 25, 2019

@mplushnikov thank you! explicit cast works fine.
is it something like: using builder in .map does not return a "clear" object type, so .orElseGet does not know what to expect? Because using classic constructors also works:

return someOptional
    .map(item -> new A())
    .orElseGet(() -> A.builder().field1(otherClass.method(something)).build()

mplushnikov added a commit that referenced this issue Oct 1, 2019
@mplushnikov
Copy link
Owner

@cosmin-rezmerita Yes, you are right. Using Builders-methods in the map-method returns generic wildcard type like ABuilder<?> and the right type cann't be automatically calculated. If you cast it/or use just constructor, its clear for the comiler, which type shlould be used.

@daniel-shuy
Copy link

Thank you so much @mplushnikov

@LK-3
Copy link

LK-3 commented Nov 30, 2020

Hi
@mplushnikov Will @SuperBuilder is having support in xjc- lombok plugin ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests