Skip to content

Commit 03bd02a

Browse files
committed
Expose primary flag on BeanDefinitionBuilder
Closes gh-23794
1 parent f16aa4a commit 03bd02a

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
@@ -302,6 +302,15 @@ public BeanDefinitionBuilder addDependsOn(String beanName) {
302302
return this;
303303
}
304304

305+
/**
306+
* Set whether this bean is a primary autowire candidate.
307+
* @since 5.1.11
308+
*/
309+
public BeanDefinitionBuilder setPrimary(boolean primary) {
310+
this.beanDefinition.setPrimary(primary);
311+
return this;
312+
}
313+
305314
/**
306315
* Set the role of this definition.
307316
*/

0 commit comments

Comments
 (0)