com.sonyericsson.jenkins.plugins.bfa.utils
Class ObjectCountPair<T>

java.lang.Object
  extended by 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
ObjectCountPair(T object, int count)
          Standard constructor.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 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


Copyright © 2004-2014. All Rights Reserved.