Class Limit

java.lang.Object
org.jacoco.report.check.Limit

public class Limit extends Object
Descriptor for a limit which is given by a Rule.
  • Field Details

  • Constructor Details

  • Method Details

    • getEntity

      public ICoverageNode.CounterEntity getEntity()
      Returns:
      the configured counter entity to check
    • setCounter

      public void setCounter(String entity)
      Sets the counter entity to check.
      Parameters:
      entity - counter entity to check
    • getValue

      public ICounter.CounterValue getValue()
      Returns:
      the configured value to check
    • setValue

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

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

      public void setMinimum(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 String getMaximum()
      Returns:
      configured maximum value, or null if no maximum is given
    • setMaximum

      public void setMaximum(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 BigDecimal parseValue(String value)
    • check

      String check(ICoverageNode node)
    • message

      private String message(String minmax, BigDecimal v, BigDecimal ref, RoundingMode mode)
    • checkRatioLimit

      private String checkRatioLimit()
    • checkRatioLimit

      private String checkRatioLimit(String minmax, BigDecimal v)