public abstract class MetricResult
extends java.lang.Object
Class containing metric results.
Constructor and Description |
---|
MetricResult() |
Modifier and Type | Method and Description |
---|---|
static MetricResult |
empty()
Create an empty metric result.
|
static MetricResult |
fromMap(java.util.Map<java.lang.String,?> values)
Create an empty metric result.
|
static MetricResult |
fromNullable(MetricResult result)
Convert a null result to an empty result.
|
abstract java.util.Map<java.lang.String,java.lang.Object> |
getValues()
Get the column values for this metric result.
|
static MetricResult |
singleton(java.lang.String name,
java.lang.Object value)
Create a singleton map result.
|
MetricResult |
withPrefix(java.lang.String pfx)
Add a prefix to this metric result’s column names.
|
MetricResult |
withSuffix(java.lang.String sfx)
Add a suffix to this metric result’s column names.
|
@Nonnull public abstract java.util.Map<java.lang.String,java.lang.Object> getValues()
Get the column values for this metric result.
@Nonnull public MetricResult withSuffix(java.lang.String sfx)
Add a suffix to this metric result’s column names. The resulting keys are of the form “key.sfx”.
sfx
- The suffix to add, or null
for no change.@Nonnull public MetricResult withPrefix(java.lang.String pfx)
Add a prefix to this metric result’s column names. The resulting keys are of the form “pfx.key”.
pfx
- The prefix to add, or null
for no change.@Nonnull public static MetricResult empty()
Create an empty metric result.
@Nonnull public static MetricResult fromNullable(@Nullable MetricResult result)
Convert a null result to an empty result.
result
- The result.empty()
if it is null.@Nonnull public static MetricResult fromMap(java.util.Map<java.lang.String,?> values)
Create an empty metric result.
@Nonnull public static MetricResult singleton(java.lang.String name, java.lang.Object value)
Create a singleton map result.
name
- The column name.value
- The column value.