Package org.altlinux.jabbix
Class JabbixMetric<T>
- java.lang.Object
-
- org.altlinux.jabbix.JabbixMetric<T>
-
- Type Parameters:
T- the type of the metric value
- Direct Known Subclasses:
JabbixActiveMetric
public class JabbixMetric<T> extends java.lang.ObjectA metric, the named value representing certain parameter of a system.- Author:
- Paul Wolneykien
-
-
Constructor Summary
Constructors Constructor Description JabbixMetric(java.lang.String key, java.lang.Class<T> type, T value)Constructs a new metric with the specified name and value type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Indicates whether some other object is "equal to" the metric.java.lang.StringgetKey()Returns the name of the metric.TgetValue()Returns the value of the metric.java.lang.Class<T>getValueType()Returns a class for the value type of the metric.java.lang.StringtoString()Returns the textual string representation of the value.voidupdateValue(java.lang.Object value)Updates the value of the metric.
-
-
-
Method Detail
-
getKey
public java.lang.String getKey()
Returns the name of the metric.- Returns:
- the name of the metric
-
getValue
public T getValue()
Returns the value of the metric.- Returns:
- the value of the metric
-
updateValue
public void updateValue(java.lang.Object value) throws java.lang.ClassCastExceptionUpdates the value of the metric.- Parameters:
value- the new value- Throws:
java.lang.ClassCastException- if type of the new value is incompatible with the value type of the metric- See Also:
MetricTable.updateMetric(JabbixMetric)
-
toString
public java.lang.String toString()
Returns the textual string representation of the value. A special "null" value is returned in the case when the metric value is null.- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" the metric. Two metrics are equal iff their keys are equal. A metric isn't equal to an object not derived from JabbixMetric.- Overrides:
equalsin classjava.lang.Object
-
getValueType
public java.lang.Class<T> getValueType()
Returns a class for the value type of the metric.- Returns:
- a class for the value type of the metric
-
-