Interface ConditionEvents


@PublicAPI(usage=INHERITANCE) public interface ConditionEvents
Collects events that occur when checking ArchConditions.
  • Method Details

    • add

      void add(ConditionEvent event)
      Adds a ConditionEvent to these events.
      Parameters:
      event - A ConditionEvent caused by an ArchCondition when checking some element
    • getInformationAboutNumberOfViolations

      Optional<String> getInformationAboutNumberOfViolations()
    • setInformationAboutNumberOfViolations

      void setInformationAboutNumberOfViolations(String informationAboutNumberOfViolations)
      Can be used to override the information about the number of violations. If absent the violated rule will simply report the number of violation lines as the number of violations (which is typically correct, since ArchUnit usually reports one violation per line). However, in cases where violations are omitted (e.g. because a limit of reported violations is configured), this information can be supplied here to inform users that there actually were more violations than reported.
      Parameters:
      informationAboutNumberOfViolations - The text to be shown for the number of times a rule has been violated
    • getViolating

      Collection<ConditionEvent> getViolating()
      Returns:
      All events that correspond to violations.
    • containViolation

      boolean containViolation()
      Returns:
      true, if these events contain any violating event, otherwise false