Class Condition.Comparison

  • All Implemented Interfaces:
    Condition
    Enclosing interface:
    Condition

    public static final class Condition.Comparison
    extends Object
    implements Condition
    accessor OP operand - the single generic leaf.
    • Constructor Detail

      • Comparison

        public Comparison​(Accessor accessor,
                          Operator op,
                          Operand operand)
        Creates a comparison leaf, or a truthiness test when no operator is given.
        Parameters:
        accessor - the left-hand accessor path
        op - the operator, or null to coerce the accessor to boolean
        operand - the right-hand operand, ignored when the operator is null
    • Method Detail

      • accessor

        public Accessor accessor()
        Returns:
        the left-hand accessor path
      • op

        public Operator op()
        Returns:
        the comparison operator, or null for boolean coercion
      • operand

        public Operand operand()
        Returns:
        the right-hand operand, or null when op is null
      • isBoolean

        public boolean isBoolean()
        Returns:
        true when this is a bare accessor coerced to boolean
      • accept

        public <R> R accept​(Condition.Visitor<R> v)
        Description copied from interface: Condition
        Dispatches to the visitor method for this node's variant.
        Specified by:
        accept in interface Condition
        Type Parameters:
        R - the visitor's result type
        Parameters:
        v - the visitor to dispatch to
        Returns:
        whatever the visitor returns