public final class EventCount extends Object
| Modifier and Type | Field and Description |
|---|---|
static EventCount |
ZERO
An
EventCount without any successes and failures. |
| Constructor and Description |
|---|
EventCount(long success,
long failure)
Deprecated.
Use
of(long, long). |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
long |
failure()
Returns the number of failure events.
|
double |
failureRate()
Returns the failure rate (failure/total), or throws an
ArithmeticException if total is 0. |
int |
hashCode() |
static EventCount |
of(long success,
long failure)
Returns a new
EventCount with the specified number of successes and failures. |
long |
success()
Returns the number of success events.
|
double |
successRate()
Returns the success rate (success/total), or throws an
ArithmeticException if total is 0. |
String |
toString() |
long |
total()
Returns the total number of events.
|
public static final EventCount ZERO
EventCount without any successes and failures.@Deprecated public EventCount(long success, long failure)
of(long, long).public static EventCount of(long success, long failure)
EventCount with the specified number of successes and failures.public long success()
public long failure()
public long total()
public double successRate()
ArithmeticException if total is 0.public double failureRate()
ArithmeticException if total is 0.Copyright © 2020 LeanCloud. All rights reserved.