Class ValueConstraint


  • public class ValueConstraint
    extends Object
    ValueConstraint class represents a field's value constraint; supports common matching expressions.
    • Method Detail

      • setValue

        public void setValue​(String value)
        set value for this constraint
        Parameters:
        value - specific value to match
      • setMinValue

        public void setMinValue​(float value)
        set minimum value
        Parameters:
        value - minimum value
      • setMaxValue

        public void setMaxValue​(float value)
        set the maximum value
        Parameters:
        value - maximum value
      • setMatchExpr

        public void setMatchExpr​(int expr)
        set field matching expression
        Parameters:
        expr - match expression
      • setCacheOnMatch

        public void setCacheOnMatch​(boolean cacheOnMatch)
        set whether to cache if there was a match
        Parameters:
        cacheOnMatch - should the field value match, enable cache?
      • setCacheOnMatchFailure

        public void setCacheOnMatchFailure​(boolean cacheOnMatchFailure)
        set whether to cache if there was a failure to match
        Parameters:
        cacheOnMatchFailure - should the field value doesn't match, enable cache?
      • matches

        public boolean matches​(Object value)
        match with the given Object value.
        Returns:
        true if the value passes the constraint, false otherwise.
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        a string representation of this value/expr element