jilt icon indicating copy to clipboard operation
jilt copied to clipboard

Does Jilt support generic classes?

Open ThibaultUrien opened this issue 3 years ago • 4 comments

It is not mentioned in the documentation. On my side it seem that classes with generic argument are given a builder that do use the argument but never declare it.

ThibaultUrien avatar Feb 09 '22 07:02 ThibaultUrien

Hey @ThibaultUrien,

thanks for opening the issue!

Can you show the code for the class you're trying to generate the Builder for?

Thanks, Adam

skinny85 avatar Feb 09 '22 07:02 skinny85

Hello Adam, thank for the quick answer. I don't have the code anymore, but I'll try to come-up with a new one.

Le mer. 9 févr. 2022 à 08:49, Adam Ruka @.***> a écrit :

Hey @ThibaultUrien https://github.com/ThibaultUrien,

thanks for opening the issue!

Can you show the code for the class you're trying to generate the Builder for?

Thanks, Adam

— Reply to this email directly, view it on GitHub https://github.com/skinny85/jilt/issues/5#issuecomment-1033444664, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTS6IORCX6XTW37SE2PD4LU2IMBHANCNFSM5N4V5J6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

ThibaultUrien avatar Feb 09 '22 13:02 ThibaultUrien

Thanks, that will be super helpful in trying to reproduce this issue!

skinny85 avatar Feb 10 '22 04:02 skinny85

@ThibaultUrien any updates here? 🙂

skinny85 avatar May 14 '22 00:05 skinny85

Not OP, but I'd imagine something like this would be nice:

class MyClass<T> {
  T myField;
}
MyClass<String> mc = MyClassBuilder.<String>myclass()
  .myField("some string")
  .build();

gbaso avatar Jan 09 '24 08:01 gbaso

Thanks @gbaso. Confirming that placing @Builder on your example MyClass does not work currently.

I'll work on a fix for this.

skinny85 avatar Jan 12 '24 06:01 skinny85

This has been fixed on the current develop branch, and will be included in the next 1.4 release (which will also cover #10, #11 and #12).

skinny85 avatar Jan 15 '24 21:01 skinny85

This has been fixed in the latest Jilt release (1.4).

I'm closing this issue as "Resolved", please comment if you run into any more problems related to this area, and I'll reopen the issue.

skinny85 avatar Jan 28 '24 23:01 skinny85