Skip to content

Commit 248ad0f

Browse files
committed
Expose primary flag on BeanDefinitionBuilder
Closes gh-23794
1 parent dc59e50 commit 248ad0f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,15 @@ public BeanDefinitionBuilder addDependsOn(String beanName) {
314314
return this;
315315
}
316316

317+
/**
318+
* Set whether this bean is a primary autowire candidate.
319+
* @since 5.1.11
320+
*/
321+
public BeanDefinitionBuilder setPrimary(boolean primary) {
322+
this.beanDefinition.setPrimary(primary);
323+
return this;
324+
}
325+
317326
/**
318327
* Set the role of this definition.
319328
*/

0 commit comments

Comments
 (0)