Package com.helixframework.conditional
Annotation Interface PropertyCondition
Represents a condition based on a property in the application environment.
This annotation is used to define individual property conditions that are evaluated
to determine if a specific configuration or bean should be activated. Each condition specifies
the name of a property, an expected value for the property, and whether the condition
should be treated as matched when the property is missing.
Property conditions are commonly used in conjunction with
ConditionalOnAllProperties
to aggregate multiple property conditions, allowing for more complex conditional logic
in determining application configurations.-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionSpecifies the expected value of the property to match.Specifies the name of a property to evaluate in the application environment. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanIndicates whether the condition should be considered a match when the specified property is missing.
-
Element Details
-
name
String nameSpecifies the name of a property to evaluate in the application environment. It is used withinPropertyConditionto identify the specific property whose value will be checked against the expected value or evaluated based on thematchIfMissingattribute.- Returns:
- the name of the property to evaluate
-
havingValue
String havingValueSpecifies the expected value of the property to match. This value is used in conjunction with the property name specified inname()to evaluate the condition. If the actual value of the property in the application environment matches this expected value, the condition is considered satisfied.- Returns:
- the expected value of the property to match
-
-
-
matchIfMissing
boolean matchIfMissingIndicates whether the condition should be considered a match when the specified property is missing. This attribute is used within aPropertyConditionto control the behavior of the condition evaluation when the property defined byname()does not exist in the application environment. If set totrue, the absence of the property is treated as a match. If set tofalse, the absence of the property prevents the condition from being satisfied.- Returns:
trueif the condition should match when the property is missing,falseotherwise
- Default:
- false
-