Class Limit


  • public class Limit
    extends java.lang.Object
    Descriptor for a limit which is given by a Rule.
    • Method Detail

      • setCounter

        public void setCounter​(java.lang.String entity)
        Sets the counter entity to check.
        Parameters:
        entity - counter entity to check
      • setValue

        public void setValue​(java.lang.String value)
        Sets the value to check.
        Parameters:
        value - value to check
      • getMinimum

        public java.lang.String getMinimum()
        Returns:
        configured minimum value, or null if no minimum is given
      • setMinimum

        public void setMinimum​(java.lang.String minimum)
        Sets the expected minimum value. If the minimum refers to a ratio it must be in the range from 0.0 to 1.0 where the number of decimal places will also determine the precision in error messages. A limit ratio may optionally be declared as a percentage where 0.80 and 80% represent the same value.
        Parameters:
        minimum - allowed minimum or null, if no minimum should be checked
      • getMaximum

        public java.lang.String getMaximum()
        Returns:
        configured maximum value, or null if no maximum is given
      • setMaximum

        public void setMaximum​(java.lang.String maximum)
        Sets the expected maximum value. If the maximum refers to a ratio it must be in the range from 0.0 to 1.0 where the number of decimal places will also determine the precision in error messages. A limit ratio may optionally be declared as a percentage where 0.80 and 80% represent the same value.
        Parameters:
        maximum - allowed maximum or null, if no maximum should be checked
      • parseValue

        private static java.math.BigDecimal parseValue​(java.lang.String value)
      • message

        private java.lang.String message​(java.lang.String minmax,
                                         java.math.BigDecimal v,
                                         java.math.BigDecimal ref,
                                         java.math.RoundingMode mode)
      • checkRatioLimit

        private java.lang.String checkRatioLimit()
      • checkRatioLimit

        private java.lang.String checkRatioLimit​(java.lang.String minmax,
                                                 java.math.BigDecimal v)