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 Summary
Constructors Constructor Description ObjectCountPair(T object, int count)
Standard constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCount(int add)
Adds argument number to the counter.static Comparator<ObjectCountPair>
countComparator()
Gets a comparator that compares the count.int
getCount()
Getter for the counter.T
getObject()
Getter for the object we are counting.
-
-
-
Constructor Detail
-
ObjectCountPair
public ObjectCountPair(T object, int count)
Standard constructor.- Parameters:
object
- the object we are countingcount
- the number of copies we have of the object
-
-
Method Detail
-
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
-
-