Class Limit
java.lang.Object
org.jacoco.report.check.Limit
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ICoverageNode.CounterEntityprivate static final Map<ICoverageNode.CounterEntity, String> private BigDecimalprivate BigDecimalprivate ICounter.CounterValueprivate static final Map<ICounter.CounterValue, String> -
Constructor Summary
ConstructorsConstructorDescriptionLimit()Creates a new instance with the following defaults: counter entity:ICoverageNode.CounterEntity.INSTRUCTIONcounter value:ICounter.CounterValue.COVEREDRATIOminimum: no limit maximum: no limit -
Method Summary
Modifier and TypeMethodDescription(package private) Stringcheck(ICoverageNode node) private Stringprivate StringcheckRatioLimit(String minmax, BigDecimal v) getValue()private Stringmessage(String minmax, BigDecimal v, BigDecimal ref, RoundingMode mode) private static BigDecimalparseValue(String value) voidsetCounter(String entity) Sets the counter entity to check.voidsetMaximum(String maximum) Sets the expected maximum value.voidsetMinimum(String minimum) Sets the expected minimum value.voidSets the value to check.
-
Field Details
-
VALUE_NAMES
-
ENTITY_NAMES
-
entity
-
value
-
minimum
-
maximum
-
-
Constructor Details
-
Limit
public Limit()Creates a new instance with the following defaults:- counter entity:
ICoverageNode.CounterEntity.INSTRUCTION - counter value:
ICounter.CounterValue.COVEREDRATIO - minimum: no limit
- maximum: no limit
- counter entity:
-
-
Method Details
-
getEntity
- Returns:
- the configured counter entity to check
-
setCounter
Sets the counter entity to check.- Parameters:
entity- counter entity to check
-
getValue
- Returns:
- the configured value to check
-
setValue
-
getMinimum
- Returns:
- configured minimum value, or
nullif no minimum is given
-
setMinimum
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 ornull, if no minimum should be checked
-
getMaximum
- Returns:
- configured maximum value, or
nullif no maximum is given
-
setMaximum
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 ornull, if no maximum should be checked
-
parseValue
-
check
-
message
-
checkRatioLimit
-
checkRatioLimit
-