Enum Class ConditionResult

java.lang.Object
java.lang.Enum<ConditionResult>
org.forgerock.opendj.ldap.ConditionResult
All Implemented Interfaces:
Serializable, Comparable<ConditionResult>, Constable

public enum ConditionResult extends Enum<ConditionResult>
The result of a tri-state logical expression. Condition results are used to represent the result of a conditional evaluation that can yield three possible values: FALSE (i.e. "no"), TRUE (i.e. "yes"), or UNDEFINED (i.e. "maybe"). A result of UNDEFINED indicates that further investigation may be required.
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Indicates that the condition evaluated to false.
    Indicates that the condition evaluated to true.
    Indicates that the condition could not be evaluated and its result is undefined.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> ConditionResult
    allOf(Iterable<T> elements, Function<T, ConditionResult> predicate)
    Applies a predicate to a sequence of elements and combines the results as if they were passed to and(ConditionResult...), except that processing short-circuits as soon as FALSE is obtained.
    and()
    Returns the logical AND of zero condition results, which is always TRUE.
    Returns the logical AND of this condition result with the provided condition result, which is TRUE if both of the condition results are TRUE, FALSE if at least one of them is FALSE, and UNDEFINED otherwise.
    and(ConditionResult... results)
    Returns the logical AND of the provided condition results, which is TRUE if all of the provided condition results are TRUE, FALSE if at least one of them is FALSE, and UNDEFINED otherwise.
    static <T> ConditionResult
    anyOf(Iterable<T> elements, Function<T, ConditionResult> predicate)
    Applies a predicate to a sequence of elements and combines the results as if they were passed to or(ConditionResult...), except that processing short-circuits as soon as TRUE is obtained.
    not()
    Returns the logical NOT of this condition result, which is TRUE if this condition result is FALSE, TRUE if it is FALSE, and UNDEFINED otherwise.
    Returns the logical NOT of the provided condition result, which is TRUE if the provided condition result is FALSE, TRUE if it is FALSE, and UNDEFINED otherwise.
    or()
    Returns the logical OR of zero condition results, which is always FALSE.
    Returns the logical OR of this condition result with the provided condition result, which is FALSE if both of the condition results are FALSE, TRUE if at least one of them is TRUE, and UNDEFINED otherwise.
    or(ConditionResult... results)
    Returns the logical OR of the provided condition results, which is FALSE if all of the provided condition results are FALSE, TRUE if at least one of them is TRUE, and UNDEFINED otherwise.
    boolean
    Converts this condition result to a boolean value.
    Returns the string representation of this condition result.
    valueOf(boolean b)
    Returns the condition result which is equivalent to the provided boolean value.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • FALSE

      public static final ConditionResult FALSE
      Indicates that the condition evaluated to false.
    • UNDEFINED

      public static final ConditionResult UNDEFINED
      Indicates that the condition could not be evaluated and its result is undefined.
    • TRUE

      public static final ConditionResult TRUE
      Indicates that the condition evaluated to true.
  • Method Details

    • values

      public static ConditionResult[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ConditionResult valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • and

      public static ConditionResult and()
      Returns the logical AND of zero condition results, which is always TRUE.
      Returns:
      The logical OR of zero condition results, which is always TRUE.
    • and

      public static ConditionResult and(ConditionResult... results)
      Returns the logical AND of the provided condition results, which is TRUE if all of the provided condition results are TRUE, FALSE if at least one of them is FALSE, and UNDEFINED otherwise. Note that TRUE is returned if the provided list of results is empty.
      Parameters:
      results - The condition results to be compared.
      Returns:
      The logical AND of the provided condition results.
    • allOf

      public static <T> ConditionResult allOf(Iterable<T> elements, Function<T, ConditionResult> predicate)
      Applies a predicate to a sequence of elements and combines the results as if they were passed to and(ConditionResult...), except that processing short-circuits as soon as FALSE is obtained.
      Type Parameters:
      T - The type of elements to be tested.
      Parameters:
      elements - The sequence of elements to be tested.
      predicate - The test.
      Returns:
      The logical AND of the test results.
    • and

      Returns the logical AND of this condition result with the provided condition result, which is TRUE if both of the condition results are TRUE, FALSE if at least one of them is FALSE, and UNDEFINED otherwise.
      Parameters:
      r - The condition result to be compared with this one.
      Returns:
      The logical AND of the two condition results.
    • not

      public static ConditionResult not(ConditionResult r)
      Returns the logical NOT of the provided condition result, which is TRUE if the provided condition result is FALSE, TRUE if it is FALSE, and UNDEFINED otherwise.
      Parameters:
      r - The condition result to invert.
      Returns:
      The logical NOT of the provided condition result.
    • not

      public ConditionResult not()
      Returns the logical NOT of this condition result, which is TRUE if this condition result is FALSE, TRUE if it is FALSE, and UNDEFINED otherwise.
      Returns:
      The logical NOT of this condition result.
    • or

      public static ConditionResult or()
      Returns the logical OR of zero condition results, which is always FALSE.
      Returns:
      The logical OR of zero condition results, which is always FALSE.
    • or

      public static ConditionResult or(ConditionResult... results)
      Returns the logical OR of the provided condition results, which is FALSE if all of the provided condition results are FALSE, TRUE if at least one of them is TRUE, and UNDEFINED otherwise. Note that FALSE is returned if the provided list of results is empty.
      Parameters:
      results - The condition results to be compared.
      Returns:
      The logical OR of the provided condition results.
    • anyOf

      public static <T> ConditionResult anyOf(Iterable<T> elements, Function<T, ConditionResult> predicate)
      Applies a predicate to a sequence of elements and combines the results as if they were passed to or(ConditionResult...), except that processing short-circuits as soon as TRUE is obtained.
      Type Parameters:
      T - The type of elements to be tested.
      Parameters:
      elements - The sequence of elements to be tested.
      predicate - The test.
      Returns:
      The logical OR of the test results.
    • or

      Returns the logical OR of this condition result with the provided condition result, which is FALSE if both of the condition results are FALSE, TRUE if at least one of them is TRUE, and UNDEFINED otherwise.
      Parameters:
      r - The condition result to be compared with this one.
      Returns:
      The logical OR of the two condition results.
    • valueOf

      public static ConditionResult valueOf(boolean b)
      Returns the condition result which is equivalent to the provided boolean value.
      Parameters:
      b - The boolean value.
      Returns:
      TRUE if b was true, otherwise FALSE .
    • toBoolean

      public boolean toBoolean()
      Converts this condition result to a boolean value. FALSE and UNDEFINED are both converted to false, and TRUE is converted to true.
      Returns:
      The boolean equivalent of this condition result.
    • toString

      public String toString()
      Returns the string representation of this condition result.
      Overrides:
      toString in class Enum<ConditionResult>
      Returns:
      The string representation of his condition result.