projectlombok / lombok

Very spicy additions to the Java programming language.
https://projectlombok.org/
Other
12.87k stars 2.38k forks source link

Make @Singular compatible with EnumSet #1189

Open lsoares opened 8 years ago

lsoares commented 8 years ago

As Set is supported by @Singular annotation, I suggest EnumSetto be as well. image Do you agree? thx

juergenzimmermann commented 7 years ago

Are there any new on this issue?

danilov0x33 commented 7 years ago

@lsoares, why mark @Singular emum fields? Docs lombok:

@Singular can only be applied to collection types known to lombok. Currently, the supported types are

lsoarestd commented 7 years ago

@lsoares, why mark @Singular emum fields?

@danilovEY: I'm referring to EnumSet; not to enum fields.

danilov0x33 commented 7 years ago

@lsoares, Hm... Although yes, it will be very useful to add support EnumSet. Just a lot of people use List or HashSet for enum type but this is a bad.

lsoarestd commented 7 years ago

Indeed. EnumSet is optimized for enums. But if nobody uses it, it may not be worth to add more code to Lombok.

danilov0x33 commented 7 years ago

I think it is not hard add this feature. Just add in handle of Singular annotation where check of null field and edit code when create instance object for Set type (replace example like this: EnumSet.noneOf(T.class))

lsoarestd commented 7 years ago

great. let's hope they'll do it. or are you proposing that I do a PR?

danilov0x33 commented 7 years ago

If you can do this, will try and may be they accept your pull request :) Because tasks they have and so many.

hwaite commented 2 years ago

EnumMap would be helpful as well.