Class OnPropertyListCondition
- java.lang.Object
- org.springframework.boot.autoconfigure.condition.SpringBootCondition
- org.springframework.boot.autoconfigure.condition.OnPropertyListCondition
- All Implemented Interfaces:
org.springframework.context.annotation.Condition
public class OnPropertyListCondition extends SpringBootCondition
Condition
that checks if a property whose value is a list is defined in the environment.- Since:
- 2.0.5
Constructor Summary
Constructors Modifier Constructor Description protected
OnPropertyListCondition(String propertyName, Supplier<ConditionMessage.Builder> messageBuilder)
Create a new instance with the property to check and the message builder to use.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConditionOutcome
getMatchOutcome(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)
Determine the outcome of the match along with suitable log output.Methods inherited from class org.springframework.boot.autoconfigure.condition.SpringBootCondition
anyMatches, logOutcome, matches, matches
Constructor Detail
OnPropertyListCondition
protected OnPropertyListCondition(String propertyName, Supplier<ConditionMessage.Builder> messageBuilder)
Create a new instance with the property to check and the message builder to use.- Parameters:
propertyName
- the name of the propertymessageBuilder
- a message builder supplier that should provide a fresh instance on each call
Method Detail
getMatchOutcome
public ConditionOutcome getMatchOutcome(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)
Description copied from class:SpringBootCondition
Determine the outcome of the match along with suitable log output.- Specified by:
getMatchOutcome
in classSpringBootCondition
- Parameters:
context
- the condition contextmetadata
- the annotation metadata- Returns:
- the condition outcome