public final class Metric extends Object
MetricRepository
,
CounterService
Constructor and Description |
---|
Metric(String name,
double value)
Create a new
Metric instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getName()
Returns the name of the metric.
|
double |
getValue()
Returns the value of the metric.
|
int |
hashCode() |
Metric |
increment(int amount)
Create a new
Metric with an incremented value. |
Metric |
set(double value)
Create a new
Metric with a different value. |
String |
toString() |
public String getName()
public double getValue()
public Metric increment(int amount)
Metric
with an incremented value.amount
- the amount that the new metric will differ from this oneMetric
instancepublic Metric set(double value)
Metric
with a different value.value
- the value of the new metricMetric
instanceCopyright © 2013. All rights reserved.