Class StatusCounter

java.lang.Object
net.masterthought.cucumber.json.support.StatusCounter

public class StatusCounter extends Object
Keeps information about statuses occurrence.
Author:
Damian Szczepanik (damianszczepanik@github)
  • Constructor Details

    • StatusCounter

      public StatusCounter(Resultsable[] resultsables)
    • StatusCounter

      public StatusCounter(Resultsable[] resultsables, Set<Status> notFailingStatuses)
    • StatusCounter

      public StatusCounter()
  • Method Details

    • incrementFor

      public void incrementFor(Status status)
      Increments finalStatus counter by single value.
      Parameters:
      status - finalStatus for which the counter should be incremented.
    • getValueFor

      public int getValueFor(Status status)
      Gets the number of occurrences for given status.
      Parameters:
      status - the status
      Returns:
      number of occurrences for given status
    • size

      public int size()
      Gets the sum of all occurrences for all statuses.
      Returns:
      sum of all occurrences for all statuses
    • getFinalStatus

      public Status getFinalStatus()
      If statuses for all items are the same then this finalStatus is returned, otherwise Status.FAILED.
      Returns:
      final status for this counter