|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.util.ResultCodeCounter
@Mutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class ResultCodeCounter
This class provides a utility that may be used to count operation results and categorize them based on the total number of results of each type. It also provides a method for retrieving result code counts, sorted by the number of occurrences for each.
Constructor Summary | |
---|---|
ResultCodeCounter()
Creates a new instance of this result code counter. |
Method Summary | |
---|---|
java.util.List<ObjectPair<ResultCode,java.lang.Long>> |
getCounts(boolean reset)
Retrieves a list of the result codes of each type along with their respective counts. |
void |
increment(ResultCode resultCode)
Increments the count for the provided result code. |
void |
increment(ResultCode resultCode,
int amount)
Increments the count for the provided result code by the specified amount. |
void |
reset()
Clears all collected data from the result code counter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResultCodeCounter()
Method Detail |
---|
public void increment(ResultCode resultCode)
resultCode
- The result code for which to increment the count.public void increment(ResultCode resultCode, int amount)
resultCode
- The result code for which to increment the count.amount
- The amount by which to increment the count.public void reset()
public java.util.List<ObjectPair<ResultCode,java.lang.Long>> getCounts(boolean reset)
reset
- Indicates whether to clear the results after obtaining
them.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |