Package com.yahoo.metrics.simple
Class Value
java.lang.Object
com.yahoo.metrics.simple.Value
Wrapper for dimension values.
- Author:
- steinar
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Marker for the type of the contained value of a Value instance. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the double wrapped by a Value if one exists.abstract Value.Discriminator
getType()
Show the (single) supported standard type representation of a Value instance.long
Get the long wrapped by a Value if one exists.static Value
of
(double value) Helper method to wrap a double as a Value.static Value
of
(long value) Helper method to wrap a long as a Value.static Value
Helper 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
-