Class Conditions
- java.lang.Object
-
- org.forgerock.opendj.config.conditions.Conditions
-
public final class Conditions extends Object
This class consists exclusively of static methods that operate on or return conditions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Conditionand(Condition... conditions)Creates a condition which evaluates totrueif and only if all of its sub-conditions aretrue.static Conditioncontains(String propertyName, String propertyStringValue)Creates a condition which evaluates totrueif and only if a property contains a particular value.static Conditionimplies(Condition premise, Condition implication)Creates a condition which evaluates tofalseif and only if the first sub-condition evaluates totrueand the second sub-condition evaluates tofalse.static ConditionisPresent(String propertyName)Creates a condition which evaluates totrueif and only if a particular property has any values specified.static Conditionnot(Condition condition)Creates a condition which evaluates totrueif the sub-condition isfalse, orfalseif the sub-condition istrue.static Conditionor(Condition... conditions)Creates a condition which evaluates tofalseif and only if all of its sub-conditions arefalse.
-
-
-
Method Detail
-
and
public static Condition and(Condition... conditions)
Creates a condition which evaluates totrueif and only if all of its sub-conditions aretrue.- Parameters:
conditions- The sub-conditions which be combined using a logical AND.- Returns:
- Returns a condition which evaluates to
trueif and only if all of its sub-conditions aretrue.
-
contains
public static Condition contains(String propertyName, String propertyStringValue)
Creates a condition which evaluates totrueif and only if a property contains a particular value.- Parameters:
propertyName- The property name.propertyStringValue- The string representation of the required property value.- Returns:
- Returns a condition which evaluates to
trueif and only if a property contains a particular value.
-
implies
public static Condition implies(Condition premise, Condition implication)
Creates a condition which evaluates tofalseif and only if the first sub-condition evaluates totrueand the second sub-condition evaluates tofalse. This can be used to represent if-then relationships.- Parameters:
premise- The sub-condition which, whentrueimplies that the implication sub-condition must also betrue.implication- The sub-condition which, must betruewhen the premise istrue.- Returns:
- Returns a condition which evaluates to
falseif and only if the first sub-condition evaluates totrueand the second sub-condition evaluates tofalse.
-
isPresent
public static Condition isPresent(String propertyName)
Creates a condition which evaluates totrueif and only if a particular property has any values specified.- Parameters:
propertyName- The property name.- Returns:
- Returns a condition which evaluates to
trueif and only if a particular property has any values specified.
-
not
public static Condition not(Condition condition)
Creates a condition which evaluates totrueif the sub-condition isfalse, orfalseif the sub-condition istrue.- Parameters:
condition- The sub-condition which will be inverted.- Returns:
- Returns a condition which evaluates to
trueif the sub-condition isfalse, orfalseif the sub-condition istrue.
-
or
public static Condition or(Condition... conditions)
Creates a condition which evaluates tofalseif and only if all of its sub-conditions arefalse.- Parameters:
conditions- The sub-conditions which be combined using a logical OR.- Returns:
- Returns a condition which evaluates to
falseif and only if all of its sub-conditions arefalse.
-
-