Class ObjectCountPair<T>

java.lang.Object
com.sonyericsson.jenkins.plugins.bfa.utils.ObjectCountPair<T>
Type Parameters:
T - the object type that we count

public class ObjectCountPair<T> extends Object
Class for keeping track of the number of copies of the same object. Can for example be used for keeping track of how many times a specific FailureCause has been triggered.
Author:
Fredrik Persson <fredrik6.persson@sonyericsson.com>
  • Constructor Details

    • ObjectCountPair

      public ObjectCountPair(T object, int count)
      Standard constructor.
      Parameters:
      object - the object we are counting
      count - the number of copies we have of the object
  • Method Details

    • getObject

      public T getObject()
      Getter for the object we are counting.
      Returns:
      the object we are counting
    • getCount

      public int getCount()
      Getter for the counter.
      Returns:
      the number of copies of the object
    • addCount

      public void addCount(int add)
      Adds argument number to the counter.
      Parameters:
      add - integer value to add
    • countComparator

      public static Comparator<ObjectCountPair> countComparator()
      Gets a comparator that compares the count.
      Returns:
      comparator