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 TypeMethodDescriptionint
getMax
(ClaimStatistic.Counter counter) Gets the limit for the specific counter.int
getMin
(ClaimStatistic.Counter counter) Gets the limit for the specific counter.boolean
Returnstrue
if any validation failed.boolean
isValid
(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.void
logIssues
(ClaimStatistic statistic) Logs all the invalid values as errors.void
setMax
(ClaimStatistic.Counter counter, int value) Sets the max value for the specified counter.void
setMin
(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()Returnstrue
if any validation failed.- Returns:
true
if 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:
true
if the count is within the limits,false
otherwise.
-
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.
-