Class ObjectCountPair<T>
java.lang.Object
com.sonyericsson.jenkins.plugins.bfa.utils.ObjectCountPair<T>
- Type Parameters:
T
- the object type that we count
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCount
(int add) Adds argument number to the counter.static Comparator<ObjectCountPair>
Gets a comparator that compares the count.int
getCount()
Getter for the counter.Getter for the object we are counting.
-
Constructor Details
-
ObjectCountPair
Standard constructor.- Parameters:
object
- the object we are countingcount
- the number of copies we have of the object
-
-
Method Details
-
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
Gets a comparator that compares the count.- Returns:
- comparator
-