Class Conditions
- java.lang.Object
-
- io.streamthoughts.azkarra.api.components.condition.Conditions
-
public final class Conditions extends Object
-
-
Constructor Summary
Constructors Constructor Description Conditions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Condition>buildConditionsForAnnotation(List<ConditionalOn> annotations)Static helper to build a list ofConditions based on the given annotation.static Conditioncompose(Condition... conditions)Static helper method to create aConditioncompose of the given ones.static Conditioncompose(List<? extends Condition> conditions)Static helper method to create aConditioncompose of the given ones.static ConditiononComponents(List<Class> types)Specify that components of the given types must be registered for the component to be enabled.static ConditiononMissingComponent(List<Class> types)Specify that components of the given types must be missing for the component to be enabled.static ConditiononPropertyEquals(String property, String value)Specify that the given property should be equal to the given value for a component to be eligible for use.static ConditiononPropertyExist(String property)Specify that the given property should be set for a component to be eligible for use. .static ConditiononPropertyMatches(String property, String pattern)Specify that the given property should be matched the given pattern for a component to be eligible for use.static ConditiononPropertyMissing(String property)Specify that the given property should be missing for a component to be eligible for use.static ConditiononPropertyNotEquals(String property, String value)Specify that the given property should be equal to the given value for a component to be eligible for use.static ConditiononPropertyTrue(String property)Specify that the given property should betruefor a component to be eligible for use.
-
-
-
Method Detail
-
compose
public static Condition compose(List<? extends Condition> conditions)
Static helper method to create aConditioncompose of the given ones.
-
compose
public static Condition compose(Condition... conditions)
Static helper method to create aConditioncompose of the given ones.
-
onPropertyExist
public static Condition onPropertyExist(String property)
Specify that the given property should be set for a component to be eligible for use. .- Parameters:
property- the property name.- Returns:
- the
Conditionobject.
-
onPropertyMissing
public static Condition onPropertyMissing(String property)
Specify that the given property should be missing for a component to be eligible for use.- Parameters:
property- the property name.- Returns:
- the
Conditionobject.
-
onPropertyEquals
public static Condition onPropertyEquals(String property, String value)
Specify that the given property should be equal to the given value for a component to be eligible for use.- Parameters:
property- the property name.- Returns:
- the
Conditionobject.
-
onPropertyNotEquals
public static Condition onPropertyNotEquals(String property, String value)
Specify that the given property should be equal to the given value for a component to be eligible for use.- Parameters:
property- the property name.- Returns:
- the
Conditionobject.
-
onPropertyMatches
public static Condition onPropertyMatches(String property, String pattern)
Specify that the given property should be matched the given pattern for a component to be eligible for use.- Parameters:
property- the property name.- Returns:
- the
Conditionobject.
-
onPropertyTrue
public static Condition onPropertyTrue(String property)
Specify that the given property should betruefor a component to be eligible for use.- Parameters:
property- the property name.- Returns:
- the
Conditionobject.
-
onComponents
public static Condition onComponents(List<Class> types)
Specify that components of the given types must be registered for the component to be enabled.- Parameters:
types- the components that should be registered.- Returns:
- the
Conditionobject.
-
onMissingComponent
public static Condition onMissingComponent(List<Class> types)
Specify that components of the given types must be missing for the component to be enabled.- Parameters:
types- the components that should be missing.- Returns:
- the
Conditionobject.
-
buildConditionsForAnnotation
public static List<Condition> buildConditionsForAnnotation(List<ConditionalOn> annotations)
Static helper to build a list ofConditions based on the given annotation.- Parameters:
annotations- theConditionalOnannotations.- Returns:
- the
Conditions.
-
-