@Mutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class ResultCodeCounter extends java.lang.Object implements java.io.Serializable
Constructor and Description |
---|
ResultCodeCounter()
Creates a new instance of this result code counter.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public ResultCodeCounter()
public void increment(@NotNull ResultCode resultCode)
resultCode
- The result code for which to increment the count.public void increment(@NotNull 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()
@NotNull public java.util.List<ObjectPair<ResultCode,java.lang.Long>> getCounts(boolean reset)
reset
- Indicates whether to clear the results after obtaining
them.