Since from the beginning of @ConditionalOnProperty
it was possible to check more than one property. The name / value attribute is an array.
@Configuration
@ConditionalOnProperty({ "property1", "property2" })
protected static class MultiplePropertiesRequiredConfiguration {
@Bean
public String foo() {
return "foo";
}
}
For simple boolean properties with an AND check you don't need a @ConditionalOnExpression
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…