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

Feature request:Add getClassesWithAllAnnotations #821

Closed
He-Pin opened this issue Feb 28, 2024 · 8 comments
Closed

Feature request:Add getClassesWithAllAnnotations #821

He-Pin opened this issue Feb 28, 2024 · 8 comments

Comments

@He-Pin
Copy link
Contributor

He-Pin commented Feb 28, 2024

Motivation:
It would be nice to get a ClassInfoList which contains the Classes annotated with both annotations, currently, only one annotation is supported.

@lukehutch
Copy link
Member

Do you want an AND or an OR operator, if multiple annotations are specified?

@He-Pin
Copy link
Contributor Author

He-Pin commented Feb 28, 2024

Currently, I'm using ClassinfoList#intersect method to handle this.

@lukehutch
Copy link
Member

Hi, I added your requested method in the git version, can you please test it?

@He-Pin
Copy link
Contributor Author

He-Pin commented Feb 28, 2024

Cool, I'm currently using

           val classInfoList = scanResult.getClassesWithAnnotation(FeatureSpec::class.java)
                .intersect(scanResult.getClassesWithAnnotation(Component::class.java))

code like this.

@lukehutch
Copy link
Member

@He-Pin please test the latest git version. Thanks.

@lukehutch
Copy link
Member

lukehutch commented Mar 5, 2024

Released in 4.8.167. Thanks for the request!

@He-Pin He-Pin changed the title Feature request:Add getClassesWithAnnotations Feature request:Add getClassesWithAllAnnotations Mar 7, 2024
@He-Pin
Copy link
Contributor Author

He-Pin commented Mar 7, 2024

@lukehutch Thanks, it works well. refs: e66ee3c#comments

@lukehutch
Copy link
Member

Great, thanks for confirming.

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

No branches or pull requests

2 participants