Class ClaimValidator

java.lang.Object
org.apache.rat.config.results.ClaimValidator

public final class ClaimValidator extends Object
Validates the ClaimStatistic results meet the specified requirements.
  • Constructor Details

    • ClaimValidator

      public ClaimValidator()
      Constructor.
  • Method Details

    • hasErrors

      public boolean hasErrors()
      Returns true if any validation failed.
      Returns:
      true if any validation failed.
    • setMax

      public void setMax(ClaimStatistic.Counter counter, int value)
      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

      public void setMin(ClaimStatistic.Counter counter, int value)
      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

      public int getMax(ClaimStatistic.Counter counter)
      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

      public int getMin(ClaimStatistic.Counter counter)
      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

      public boolean isValid(ClaimStatistic.Counter counter, int count)
      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

      public void logIssues(ClaimStatistic statistic)
      Logs all the invalid values as errors.
      Parameters:
      statistic - The statistics that contain the run values.
    • listIssues

      public List<String> listIssues(ClaimStatistic statistic)
      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.