Package com.yahoo.metrics.simple
Class Value
java.lang.Object
com.yahoo.metrics.simple.Value
Wrapper for dimension values.
- Author:
- steinar
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumMarker for the type of the contained value of a Value instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet the double wrapped by a Value if one exists.abstract Value.DiscriminatorgetType()Show the (single) supported standard type representation of a Value instance.longGet the long wrapped by a Value if one exists.static Valueof(double value) Helper method to wrap a double as a Value.static Valueof(long value) Helper method to wrap a long as a Value.static ValueHelper method to wrap a string as a Value.Get the string wrapped by a Value if one exists.
-
Constructor Details
-
Value
public Value()
-
-
Method Details
-
longValue
Get the long wrapped by a Value if one exists.- Throws:
UnsupportedOperationException- if LONG is not returned by {getType().
-
doubleValue
Get the double wrapped by a Value if one exists.- Throws:
UnsupportedOperationException- if DOUBLE is not returned by {getType().
-
stringValue
Get the string wrapped by a Value if one exists.- Throws:
UnsupportedOperationException- if STRING is not returned by {getType().
-
getType
Show the (single) supported standard type representation of a Value instance. -
of
Helper method to wrap a long as a Value. The instance returned may or may not be unique.- Parameters:
value- the value to wrap- Returns:
- an immutable wrapper
-
of
Helper method to wrap a double as a Value. The instance returned may or may not be unique.- Parameters:
value- the value to wrap- Returns:
- an immutable wrapper
-
of
Helper method to wrap a string as a Value. The instance returned may or may not be unique.- Parameters:
value- the value to wrap- Returns:
- an immutable wrapper
-