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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Condition
    A condition which always evaluates to false.
    static final Condition
    A condition which always evaluates to true.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Condition
    and(Condition... conditions)
    Creates a condition which evaluates to true if and only if all of its sub-conditions are true.
    static Condition
    contains(String propertyName, String propertyStringValue)
    Creates a condition which evaluates to true if and only if a property contains a particular value.
    static Condition
    implies(Condition premise, Condition implication)
    Creates a condition which evaluates to false if and only if the first sub-condition evaluates to true and the second sub-condition evaluates to false.
    static Condition
    isPresent(String propertyName)
    Creates a condition which evaluates to true if and only if a particular property has any values specified.
    static Condition
    not(Condition condition)
    Creates a condition which evaluates to true if the sub-condition is false, or false if the sub-condition is true.
    static Condition
    or(Condition... conditions)
    Creates a condition which evaluates to false if and only if all of its sub-conditions are false.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • FALSE

      public static final Condition FALSE
      A condition which always evaluates to false.
    • TRUE

      public static final Condition TRUE
      A condition which always evaluates to true.
  • Method Details

    • and

      public static Condition and(Condition... conditions)
      Creates a condition which evaluates to true if and only if all of its sub-conditions are true.
      Parameters:
      conditions - The sub-conditions which be combined using a logical AND.
      Returns:
      Returns a condition which evaluates to true if and only if all of its sub-conditions are true.
    • contains

      public static Condition contains(String propertyName, String propertyStringValue)
      Creates a condition which evaluates to true if 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 true if and only if a property contains a particular value.
    • implies

      public static Condition implies(Condition premise, Condition implication)
      Creates a condition which evaluates to false if and only if the first sub-condition evaluates to true and the second sub-condition evaluates to false. This can be used to represent if-then relationships.
      Parameters:
      premise - The sub-condition which, when true implies that the implication sub-condition must also be true.
      implication - The sub-condition which, must be true when the premise is true.
      Returns:
      Returns a condition which evaluates to false if and only if the first sub-condition evaluates to true and the second sub-condition evaluates to false.
    • isPresent

      public static Condition isPresent(String propertyName)
      Creates a condition which evaluates to true if and only if a particular property has any values specified.
      Parameters:
      propertyName - The property name.
      Returns:
      Returns a condition which evaluates to true if and only if a particular property has any values specified.
    • not

      public static Condition not(Condition condition)
      Creates a condition which evaluates to true if the sub-condition is false, or false if the sub-condition is true.
      Parameters:
      condition - The sub-condition which will be inverted.
      Returns:
      Returns a condition which evaluates to true if the sub-condition is false, or false if the sub-condition is true.
    • or

      public static Condition or(Condition... conditions)
      Creates a condition which evaluates to false if and only if all of its sub-conditions are false.
      Parameters:
      conditions - The sub-conditions which be combined using a logical OR.
      Returns:
      Returns a condition which evaluates to false if and only if all of its sub-conditions are false.