Reputation: 6649
I am using Spring Boot autoconfiguration to load a bean in the context in case there is at least one of 3 beans present.
I need something like:
@Bean
@ConditionalOnANYClass({ CreateHandler.class, UpdateHandler.class, DeleteHandler.class})
Any smart solution or out-of-the-box annotation for the logical OR?
Upvotes: 1
Views: 401
Reputation: 6649
Interesting report from the very Spring Gitub Issue track: https://github.com/spring-projects/spring-boot/issues/5279
Upvotes: 0
Reputation: 116111
You can use AnyNestedCondition
with one nested condition per class that you want to match.
Upvotes: 2