public class ExternalCounter extends Object implements Counter
ExternalValue value
This object is read only and the mutating methods throw UnsupportedOperationException if called. The
reasoning for this is that it cant know how to change its delegate ExternalValue.
ExternalValue| Constructor and Description |
|---|
ExternalCounter(String name,
ExternalValue externalValue)
Constructs a
Counter that reads its value from the ExternalValue provided. |
| Modifier and Type | Method and Description |
|---|---|
long |
addAndGet(long delta)
Adds the delta value to the current value and returns the new value.
|
int |
compareTo(Instrument that) |
String |
getName() |
long |
getValue() |
long |
incrementAndGet()
Returns the new value after one has been added to the Counter.
|
String |
toString() |
public ExternalCounter(String name, ExternalValue externalValue)
Counter that reads its value from the ExternalValue provided.name - the name of the external counterexternalValue - - the external value to read its value from.IllegalArgumentException - if the externalValue is nullpublic String getName()
getName in interface Instrumentpublic long incrementAndGet()
CounterincrementAndGet in interface Counterpublic long addAndGet(long delta)
Counterpublic long getValue()
getValue in interface Instrumentpublic int compareTo(Instrument that)
compareTo in interface Comparable<Instrument>Copyright © 2016 Atlassian. All rights reserved.