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 ofCondition
s based on the given annotation.static Condition
compose(Condition... conditions)
Static helper method to create aCondition
compose of the given ones.static Condition
compose(List<? extends Condition> conditions)
Static helper method to create aCondition
compose of the given ones.static Condition
onComponents(List<Class> types)
Specify that components of the given types must be registered for the component to be enabled.static Condition
onMissingComponent(List<Class> types)
Specify that components of the given types must be missing for the component to be enabled.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.static Condition
onPropertyExist(String property)
Specify that the given property should be set for a component to be eligible for use.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.static Condition
onPropertyMissing(String property)
Specify that the given property should be missing for a component to be eligible for use.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.static Condition
onPropertyTrue(String property)
Specify that the given property should betrue
for a component to be eligible for use.
-
-
-
Method Detail
-
compose
public static Condition compose(List<? extends Condition> conditions)
Static helper method to create aCondition
compose of the given ones.
-
compose
public static Condition compose(Condition... conditions)
Static helper method to create aCondition
compose 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
Condition
object.
-
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
Condition
object.
-
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
Condition
object.
-
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
Condition
object.
-
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
Condition
object.
-
onPropertyTrue
public static Condition onPropertyTrue(String property)
Specify that the given property should betrue
for a component to be eligible for use.- Parameters:
property
- the property name.- Returns:
- the
Condition
object.
-
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
Condition
object.
-
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
Condition
object.
-
buildConditionsForAnnotation
public static List<Condition> buildConditionsForAnnotation(List<ConditionalOn> annotations)
Static helper to build a list ofCondition
s based on the given annotation.- Parameters:
annotations
- theConditionalOn
annotations.- Returns:
- the
Condition
s.
-
-