Enum Class Quantifier

java.lang.Object
java.lang.Enum<Quantifier>
org.klojang.check.relation.Quantifier
All Implemented Interfaces:
Serializable, Comparable<Quantifier>, Constable

public enum Quantifier extends Enum<Quantifier>
Symbolic constants for logical quantifiers. ComposablePredicate and ComposableIntPredicate let you use logical quantifiers to define not just a relation between one value and another value, but also between one value and an array of other values:

 Check.that(list).is(notNull().and(contains(), noneOf(), "to", "be", "or", "not"));
 

(Strictly speaking the value domain of a logical quantifier would better be modeled as a Set. For convenience sake, however, it is modeled as a varargs array within Klojang Check.)

See Also:
  • Enum Constant Details

    • ALL

      public static final Quantifier ALL
      Symbolic constant for the universal quantifier (∀).
    • ANY

      public static final Quantifier ANY
      Symbolic constant for the existential quantifier (∃).
    • NONE

      public static final Quantifier NONE
      Symbolic constant for the negation of the existential quantifier (¬∃).
  • Method Details

    • values

      public static Quantifier[] 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 Quantifier 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
    • allOf

      public static Quantifier allOf()
      Returns ALL.
      Returns:
      Quantifier.ALL
    • anyOf

      public static Quantifier anyOf()
      Returns ANY.
      Returns:
      Quantifier.ANY
    • noneOf

      public static Quantifier noneOf()
      Returns NONE.
      Returns:
      Quantifier.NONE