Enum Operator

    • Enum Constant Detail

      • EQ

        public static final Operator EQ
        Equality within a value kind - type names compared in canonical form, numbers compared as doubles across int and real, and two nulls equal.
      • NEQ

        public static final Operator NEQ
        Negation of EQ, so two values of incomparable kinds are unequal.
      • LT

        public static final Operator LT
        Strictly less than, numeric operands only; false for any other kind pairing.
      • LTE

        public static final Operator LTE
        Less than or equal, numeric operands only; false for any other kind pairing.
      • GT

        public static final Operator GT
        Strictly greater than, numeric operands only; false for any other kind pairing.
      • GTE

        public static final Operator GTE
        Greater than or equal, numeric operands only; false for any other kind pairing.
      • MATCHES

        public static final Operator MATCHES
        Regular-expression match of the left string against the right pattern.
      • CONTAINS

        public static final Operator CONTAINS
        Substring or membership containment, depending on the operand kinds.
      • STARTS_WITH

        public static final Operator STARTS_WITH
        String prefix test; false unless both operands are strings.
      • ENDS_WITH

        public static final Operator ENDS_WITH
        String suffix test; false unless both operands are strings.
      • IN

        public static final Operator IN
        Set membership; false unless the right operand is a set.
    • Method Detail

      • values

        public static Operator[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Operator c : Operator.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Operator valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • test

        public boolean test​(Value lhs,
                            Value rhs)
        Applies this operator, dispatching on ValueKind.
        Parameters:
        lhs - the left operand
        rhs - the right operand
        Returns:
        true if the operator holds between the two values