Package org.apache.rat.config.results
Class ClaimValidator
java.lang.Object
org.apache.rat.config.results.ClaimValidator
Validates the ClaimStatistic results meet the specified requirements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetMax(ClaimStatistic.Counter counter)Gets the limit for the specific counter.intgetMin(ClaimStatistic.Counter counter)Gets the limit for the specific counter.booleanReturnstrueif any validation failed.booleanisValid(ClaimStatistic.Counter counter, int count)Determines if the specified count is within the limits for the counter.listIssues(ClaimStatistic statistic)Creates a list of items that have issues.voidlogIssues(ClaimStatistic statistic)Logs all the invalid values as errors.voidsetMax(ClaimStatistic.Counter counter, int value)Sets the max value for the specified counter.voidsetMin(ClaimStatistic.Counter counter, int value)Sets the max value for the specified counter.
-
Constructor Details
-
ClaimValidator
public ClaimValidator()Constructor.
-
-
Method Details
-
hasErrors
public boolean hasErrors()Returnstrueif any validation failed.- Returns:
trueif any validation failed.
-
setMax
Sets the max value for the specified counter.- Parameters:
counter- the counter to set the limit for.value- the value to set. A negative value specifies no maximum value.
-
setMin
Sets the max value for the specified counter.- Parameters:
counter- the counter to set the limit for.value- the value to set. A negative value specifies no maximum value.
-
getMax
Gets the limit for the specific counter.- Parameters:
counter- the counter to get the limit for.- Returns:
- the limit for the counter or 0 if not set.
-
getMin
Gets the limit for the specific counter.- Parameters:
counter- the counter to get the limit for.- Returns:
- the limit for the counter or 0 if not set.
-
isValid
Determines if the specified count is within the limits for the counter.- Parameters:
counter- The counter to check.count- the limit to check.- Returns:
trueif the count is within the limits,falseotherwise.
-
logIssues
Logs all the invalid values as errors.- Parameters:
statistic- The statistics that contain the run values.
-
listIssues
Creates a list of items that have issues.- Parameters:
statistic- The statistics that contain the run values.- Returns:
- a collection of counter names that are invalid.
-